home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / gapdr.zip / GAPQBDR.TXT < prev   
Text File  |  1989-01-18  |  129KB  |  3,037 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.           
  24.                                        GAPQBDR
  25.                                           
  26.           
  27.                       Door Interface Module - January 18, 1989
  28.                                           
  29.            A Professional Development Kit For The Professional Programmer
  30.                                           
  31.           
  32.           
  33.                 (C) Copyright 1988, 1989 The GAP Development Company
  34.                                           
  35.                                  ALL RIGHTS RESERVED
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                   TABLE OF CONTENTS
  74.           
  75.  
  76.  
  77.  
  78.  
  79.  
  80.                                                                   Page
  81.           
  82.                DESCRIPTION                                           2
  83.                GETTING STARTED                                       3
  84.                COMPILING AND LINKING                                 6
  85.                SYSOP SETUP AND FUNCTIONS                             8
  86.                GLOBAL VARIABLES                                     11
  87.                    CONSTANTS                                        11
  88.                    ANSI CONSTANTS                                   11
  89.                    DOOR.SYS VARIABLES                               12
  90.                        INTEGERS                                     12
  91.                        LONGS                                        12
  92.                        STRINGS                                      12
  93.                    GAPQBDR GLOBALS                                  13
  94.                        INTEGERS                                     13
  95.                        LONGS                                        13
  96.                        STRINGS                                      13
  97.                    GAPDOS.DAT VARIABLES                             13
  98.                    USERS.DAT VARIABLES                              14
  99.                    PCBOARD.SYS VARIABLES                            15
  100.                    PCB USERS VARIABLES                              15
  101.                GLOBAL VARIABLES - ALPHABETICALLY By Type            17
  102.                    CONSTANTS                                        17
  103.                    INTEGERS                                         17
  104.                    LONGS                                            18
  105.                    STRINGS                                          18
  106.                FUNCTIONS AND SUBROUTINES - QUICK REFERENCE          21
  107.                FUNCTIONS AND SUBROUTINES - REFERENCE                22
  108.                REGISTRATION INFORMATION                             41
  109.                GAPQBDR REGISTRATION                                 42
  110.                INDEX                                                43
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  137.  
  138.  
  139.                                      DESCRIPTION
  140.                                      -----------
  141.           
  142.           GAPQBDR is a professional development kit for Bulletin Board Door
  143.           programmers.   It can  also be  used to facilitate the writing of
  144.           stand alone  communications programs.   Written entirely in Quick
  145.           Basic (with  a little help from some Assembler support routines),
  146.           it is  fast, reliable,  easy to use, and easy to incorporate into
  147.           the serious programmer's source code.
  148.           
  149.           Features Include :
  150.           
  151.             o  Interfaces with GAP Communications and pcboard.
  152.             o  Full communications support.
  153.             o  Supports CTS checking, even at 300 bps, for error free
  154.                transmissions.
  155.             o  Does not require watchdog or CTTY.
  156.             o  Uses ANSI colors instead of Basic's color statements so the
  157.                sysop sees what the caller sees.
  158.             o  High speed text file display.
  159.             o  Supports ANSI color and ASCII text files with no programming
  160.                effort other than to make a single subroutine call.
  161.             o  Easy to use Random Number Generator.
  162.             o  Informative Status Line display.
  163.             o  Monitors keyboard activity and caller time remaining.
  164.             o  Easy interfacing to BBS system and user files.
  165.             o  Sysop chat with full word wrapping.
  166.             o  Allows the sysop to shell to DOS.
  167.             o  "Remembers" the default drive and directory which prevents
  168.                file access errors.
  169.             o  Credits caller with time spent chatting or while sysop is in
  170.                a DOS shell.
  171.             o  Sysop can twit caller without caller ever knowing the sysop
  172.                is watching.
  173.             o  Caller time can be increased or decreased.
  174.             o  Full programmer control of whether or not to update the BBS
  175.                system files.
  176.             o  Time calculations are not dependent on the "seconds since
  177.                midnight" and are thus unsusceptible to the midnight roll
  178.                over.
  179.             o  Timer routines are hardware independent.
  180.             o  Allows the sysop to override the "more" prompt during file
  181.                shows.
  182.             o  Allows the sysop to "force" a file display.
  183.             o  Automatic detection of multi-user system.
  184.             o  Input routines are consistent throughout the program.
  185.             o  Uses the latest in Quick Basic features.
  186.             o  Extremely easy interfacing to door programs.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                        Page 2
  197.  
  198.  
  199.  
  200.  
  201.  
  202.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  203.  
  204.  
  205.                                    GETTING STARTED
  206.                                    ---------------
  207.           
  208.           GAPQBDR is distributed in archived format.  The contents of the
  209.           archive should be as follows:
  210.           
  211.                GAPQBDR.TXT    -    This documentation.
  212.                GAPQBDR.QLB    -    Library routines for QB environment.
  213.                GAPQBDR.LIB    -    Standard Library routines for BC.
  214.                GAPQBDR.BI     -    Door Interface include file.
  215.                DOOR.ARC       -    Sample program illustrating many of
  216.                                    the features of GAPQBDR.
  217.                FIXDTR.TXT     -    Instructions for making DTR patches.
  218.                READ.ME        -    Any pertinent information which you
  219.                                    should read.
  220.           
  221.           
  222.           If you purchased the source code to GAPQBDR, the following files
  223.           are included in an archive called GAPQBSRC:
  224.           
  225.                GAPQBDR.BAS    -    Basic source
  226.                KEYBRD.ASM     -    Assembler source for keybrd function.
  227.                MAKEQBDR.BAT   -    Batch file for compiling the source
  228.                                    modules and creating libraries.
  229.                QBDRLIB        -    LIB response file.
  230.                QBDRQLB        -    Linker response file.
  231.                SRCREAD.ME     -    Any pertinent information which you
  232.                                    should read.
  233.           
  234.           In addition,  you will  need the  file QB.BI which is distributed
  235.           with the   Microsoft QB disks.  You will also need  a DTR patched
  236.           version of  BCOM45.LIB and  BRUN45.EXE (depending  upon  how  you
  237.           distribute your  executable files).   The GAPQBDR module includes
  238.           routines to  turn DTR  back on  after Basic turns it off when the
  239.           communications port is  closed, however  this  is  an  unreliable
  240.           method of  insuring that  the  modem  will  not  respond  to  the
  241.           momentary drop  of DTR  by dropping  carrier.  Many modems simply
  242.           respond too quickly to the split second drop of DTR.  It would be
  243.           nice if  Microsoft would  leave the  communications port they way
  244.           they found it!
  245.           
  246.           Place the  files in your QB work directory.  Make sure that QB.BI
  247.           is accessible to the compiler.
  248.           
  249.           Throughout this  document, the terms function, routine, procedure
  250.           and subroutine  are used  interchangeably.   However,  pay  close
  251.           attention to  the return  value and  the  examples.    In  QB,  a
  252.           function returns a value, where as a sub program does not.
  253.           
  254.           If you  use an external editor to write your programs, the editor
  255.           must allow  control characters  to be entered and displayed.  The
  256.           ANSI constants  are initialized by literal characters and if your
  257.           editor removes  the ESC  character from  the constants, your ANSI
  258.           displays will be quite messy.
  259.  
  260.  
  261.  
  262.                                        Page 3
  263.  
  264.  
  265.  
  266.  
  267.  
  268.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  269.  
  270.  
  271.           If you  are using  the QB  environment, you will need to load the
  272.           door module  along with  your source program.  To do so, type the
  273.           following :
  274.           
  275.                QB door /L GAPQBDR
  276.           
  277.                (where door is the name of your basic source program)
  278.           
  279.           If you  fail to  load the  quick library along with your program,
  280.           you will  receive a  great many  "subprogram not  defined" errors
  281.           when you try to compile or run your program.
  282.           
  283.           We are a firm supporter of declaring all variables prior to their
  284.           use.   Not only  does it  make your  programs easier to debug, it
  285.           makes them  easier   to read   and follow.  We recommend that you
  286.           follow our guidelines and declare all of your global variables at
  287.           the beginning of your program, after including GAPQBDR.BI.
  288.           
  289.           At the  very beginning  of your  program, you  must  include  the
  290.           GAPQBDR.BI file.   Without this file, nothing will work.  It must
  291.           be the first directive in your source file.  To include the file,
  292.           you type the following at the beginning of you source program:
  293.           
  294.                '$INCLUDE: 'GAPQBDR.BI'
  295.           
  296.           Do not  under any  circumstances use the DEF type statements (IE,
  297.           DEFINT A-Z).   This  is the  lazy persons  method of programming.
  298.           Typedef your variables by either declaring them ahead of time, or
  299.           by appending the type after the name (IE, A$, I%).
  300.           
  301.           If you  need to use your own On Error routines, keep in mind that
  302.           when you  initialize the  door, the  On Error  trap will  be  re-
  303.           routed.  If you subsequently change the Error Trap address, it is
  304.           your responsibility to deal with any run time errors.
  305.           
  306.           The user defined keys  of 15, 16, 17, and 18 are reserved for use
  307.           by GAPQBDR.   If  you use  the ON KEY statement with user defined
  308.           keys, remember that the above four keys are RESERVED.
  309.           
  310.           You are now ready to begin your program.  You may now declare and
  311.           initialize your  own variables,  initialize your program, or what
  312.           have you.
  313.           
  314.           The first  thing that must be done prior to using any of the door
  315.           functions, is  to initialize  GAPQBDR itself.   This  is done  by
  316.           making a call to read.cnf.  Read.cnf opens the configuration file
  317.           (the name  of which you pass as a parameter), reads the first two
  318.           lines of  the file,  and sets  the Error  Trap address.   If  the
  319.           configuration file  cannot be  found, the  program will end.  The
  320.           format of the configuration file is as follows:
  321.           
  322.           -----------------------------------------
  323.           c:\gap
  324.           The Crow's Nest
  325.  
  326.  
  327.  
  328.                                        Page 4
  329.  
  330.  
  331.  
  332.  
  333.  
  334.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  335.  
  336.  
  337.           The first  line of  the file  is the  path  to  the  BBS  default
  338.           directory.   The second  line is  the  name  of  the  BBS.    The
  339.           configuration file is usually given a name similar to the name of
  340.           your door  program, with  a CNF  extension.   Read.cnf will leave
  341.           this file  open for  your use.   If  you have  any  configuration
  342.           options of  your own,  you may  place them in this file beginning
  343.           with line  3.  Do not read your configuration options until after
  344.           making a  call to  init.door (which should be the second function
  345.           call in  your program).  Upon return from init.door, you are free
  346.           to read  your configuration  options (if any).  At this time, you
  347.           should close the configuration file.  Its file number is #1.
  348.           
  349.           Normally, your  program is  invoked with a command line parameter
  350.           giving the name of the configuration file to use:
  351.           
  352.                (IE, DOOR DOOR.CNF).
  353.           
  354.           You would  use the COMMAND$ function to extract the configuration
  355.           parameter and  then pass  this parameter  on to  read.cnf.   This
  356.           allows the  end user  to use a single program (your program) with
  357.           multiple configuration files.  This is especially important under
  358.           multi-user systems where separate configuration files are needed.
  359.           
  360.           The configuration  file is  opened as  a sequential file so using
  361.           Line Input #1 would be appropriate for reading any data.
  362.           
  363.           If there were no errors, read.cnf will return.  You must now make
  364.           a call to init.door.  Init.door uses the information derived from
  365.           line 1  of the configuration file to open and read DOOR.SYS (GAP)
  366.           or PCBOARD.SYS (PCB)  as well  as the BBS configuration file.  In
  367.           addition, init.door  opens the  communications port (if  a remote
  368.           user is  on), initializes  some global variables, and initializes
  369.           the random  number generator.   If  there is  an error, init.door
  370.           will not return.  Instead it will end the program.
  371.           
  372.           That is  basically all  you have  to do to initialize the GAPQBDR
  373.           module.   When your  program ends,  you  should  clean  house  if
  374.           necessary and  call leave.   Leave closes the communications port
  375.           and any  open files,  sends a sign off message to the caller, and
  376.           then exits to DOS.
  377.           
  378.           Things to remember:
  379.           
  380.             To get  the ball  rolling,  include  GAPQBDR.BI  as  the  first
  381.             directive in your source program.
  382.             
  383.             To initialize  the door,  call read.cnf  with the  name of your
  384.             programs configuration file.  Call init.door.
  385.             
  386.             Call leave when your program is finished.
  387.             
  388.             With the  exception of  file #1  which  is  used  to  read  the
  389.             configuration file  and which  YOU should close, the only other
  390.             file number  which is  hard coded  is  file  #9.  This  is  the
  391.  
  392.  
  393.  
  394.                                        Page 5
  395.  
  396.  
  397.  
  398.  
  399.  
  400.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  401.  
  402.  
  403.             communications file.  GAPQBDR uses good programming practice by
  404.             asking Basic  for a file number rather than telling Basic which
  405.             number to use.
  406.             
  407.             All input  and output  should be  performed through the GAPQBDR
  408.             functions.   The sample  program gives  good examples on how to
  409.             accomplish this.
  410.             
  411.             To determine if the BBS is a single or multi user system, check
  412.             the variable called node.  If it is anything other than 0, then
  413.             the BBS is multi-user and you should read/write your data files
  414.             with sharing attributes.
  415.             
  416.             The default mode of operation is GAP mode.  This means that you
  417.             should not  use those  functions which  access PCB  files.   To
  418.             determine if  the BBS  is a  PCB  system,  check  the  variable
  419.             do.pcb. If this is set to 1, then the BBS is PCB and you should
  420.             not access  GAP files.   The variable do.pcb is set to 1 if the
  421.             environment variable GAPQBDR is set equal to PCB.
  422.           
  423.           
  424.           To test  your program,  you  will  need  a  DOOR.SYS (GAP)  or  a
  425.           PCBOARD.SYS (PCB) file  that was  written for  local  exit.    Of
  426.           course, you  can always  modify any  DOOR.SYS file and change the
  427.           first line  so that  it reads COM0:.  In addition, for a GAP BBS,
  428.           the  GAPBBS.CNF   file  must   be   accessible   (PCBOARD.DAT and
  429.           USERS for PCB).   A complete set of sample files are provided for
  430.           testing your program under local mode.  Experience has shown that
  431.           although  the  QB  environment  editor  makes  for  a  cumbersome
  432.           programmers editor,  testing programs  inside QB  is perhaps  the
  433.           easiest and  most efficient  way to  test.   The  environment  is
  434.           wonderful for  catching syntax  errors and even more fantastic at
  435.           allowing the  programmer to  correct those errors and continue to
  436.           run the program.
  437.           
  438.           
  439.                                 COMPILING AND LINKING
  440.                                 ---------------------
  441.           
  442.           GAPQBDR has already been compiled with the necessary compile time
  443.           switches.
  444.           
  445.           To compile your programs, use whatever switches are required with
  446.           the following commands :
  447.           
  448.                bc doorname;
  449.                link doorname,,NUL.MAP,+gapqbdr
  450.           
  451.                Where doorname is the name of your program.
  452.           
  453.           
  454.           WARNING: Do  NOT, under  any circumstance,  use the  /mbf compile
  455.                    time  switch.    GAPQBDR  expects  all  of  its  numeric
  456.                    variables to  be in  IEEE format.  If you have a need to
  457.  
  458.  
  459.  
  460.                                        Page 6
  461.  
  462.  
  463.  
  464.  
  465.  
  466.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  467.  
  468.  
  469.                    manipulate a  PCB data  file (which  contains MBF format
  470.                    numbers), declare  the MBF  fields as  strings  and  use
  471.                    either CVSMBF or CVDMBF to convert the strings. You will
  472.                    see an  example of  this in the record structure for the
  473.                    PCB USERS  file.   The fields  downbytes and upbytes are
  474.                    actually  DOUBLES.  The  field  lastmsg  is  actually  a
  475.                    SINGLE.   To convert downbytes you can use : downbytes =
  476.                    CVDMBF(pcbuser.downbytes). If  you update  this field in
  477.                    the  PCB  USERS  file,  you  can  save  it  by  using  :
  478.                    pcbuser.downbytes = MKDMBF$(downbytes).
  479.                    
  480.                    The Microsoft  Binary format for numbers should never be
  481.                    used. Support for the MBF format will no doubt disappear
  482.                    in future  versions of  QB.   You should  ALWAYS use the
  483.                    latest versions and features of your compiler.
  484.                    
  485.                    IEEE Format  numbers provide  for greater  accuracy  and
  486.                    wider ranges.  They are compatible with assembler and C.
  487.                    They also allow you to use a math coprocessor, if one is
  488.                    available.
  489.                    
  490.                    You should  also use  LONG INTEGERS instead of SINGLE or
  491.                    DOUBLE  precision  numbers  where  appropriate.  A  long
  492.                    integer can  represent a number as great as 2.1 billion!
  493.                    This should  more than  cover your  needs.    Especially
  494.                    since a BBS (door) program rarely uses or has a need for
  495.                    real numbers.
  496.                    
  497.                    If you  are converting an old door program that uses MBF
  498.                    format numbers  in random access files, you will need to
  499.                    use either  the  QB  supplied  conversion  functions  or
  500.                    convert your  random access  data files  to the new user
  501.                    defined binary type record structures.
  502.           
  503.           If you  purchased the source code to GAPQBDR, there are batch and
  504.           response files  to aid  in re-compiling and librarying the source
  505.           modules.
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                                        Page 7
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  533.  
  534.  
  535.                               SYSOP SETUP AND FUNCTIONS
  536.                               -------------------------
  537.           
  538.           These sysop  setup and  function descriptions should be placed in
  539.           the documentation  of your  door program.   You should, of course
  540.           change the setup information to fit your particular needs.
  541.           
  542.           
  543.           
  544.           Door programs written with the GAPQBDR Door Interface Module will
  545.           run on  GAP Communications  version 3  and  greater  and  on  PCB
  546.           version 14 and greater.
  547.           
  548.           To configure the door for a particular BBS setup, a configuration
  549.           file must  be used.   At the very minimum, this file will contain
  550.           two lines.   It  may contain  more than  two,  depending  upon  a
  551.           particular doors  configuration requirements.   The  name of  the
  552.           file is  usually the  same as that of the door program but with a
  553.           CNF extension.   The  minimum requirements  for the  file are  as
  554.           follows:
  555.           
  556.                c:\gap
  557.                The Crow's Nest
  558.           
  559.                The first  line  is  the  full  path  to  your  BBS  default
  560.                directory.   For GAP, this is usually C:\GAP.  For PCB, this
  561.                is usually C:\PCB.  The second line is the name of your BBS.
  562.           
  563.           GAPQBDR will  obtain the  sysop's name from the BBS configuration
  564.           file.
  565.           
  566.           You must  now create a batch file to invoke the door.  This batch
  567.           file is  placed in your BBS default directory.  Such a batch file
  568.           might look like this:
  569.           
  570.                echo off
  571.                cd \gap\doors\tl
  572.                tl tl.cfg
  573.                cd \gap
  574.                gap
  575.           
  576.           As you  can see, the door is invoked by passing the configuration
  577.           file name as a parameter.
  578.           
  579.           You will  also need  to modify your doors menu files and the data
  580.           file that  tells the  BBS what  your doors  are and  the security
  581.           level needed to access them.  For GAP, these are respectively:
  582.           
  583.                DOORM
  584.                DOORMG
  585.                DOORS.DAT
  586.           
  587.           Please refer  to your  BBS documentation  for details on  setting
  588.           these files up.
  589.  
  590.  
  591.  
  592.                                        Page 8
  593.  
  594.  
  595.  
  596.  
  597.  
  598.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  599.  
  600.  
  601.           If you  are running  multi-nodes, simply  create a  separate door
  602.           configuration file for each node, and number them.  For instance,
  603.           for a  3 node  system, you might have the following configuration
  604.           files:
  605.           
  606.                TL1.CFG
  607.                TL2.CFG
  608.                TL3.CFG
  609.           
  610.           The only difference between the three would be the 1st line which
  611.           points to the default directory for the particular node.
  612.           
  613.           Multi-user operation  is automatic.   For  GAP, the  presence  of
  614.           DUMMY.LOK in  the MAIN  directory triggers  multi-user operation.
  615.           For PCB, this information is derived from the PCBOARD.DAT file.
  616.           
  617.           The following  files are  read during  door initialization.  They
  618.           must be present or the door will not operate.
  619.           
  620.                GAP                      PCB
  621.                ----------------         ----------------
  622.                DOOR.SYS                 PCBOARD.SYS
  623.                GAPBBS.CNF               PCBOARD.DAT
  624.                                         USERS
  625.           
  626.           In addition,  a particular  door may access the GAP USERS.DAT and
  627.           GAPDOS.DAT files.
  628.           
  629.           The default mode of operation for any door that is developed with
  630.           GAPQBDR is  the GAP  mode.   To run the door under a PCB BBS, you
  631.           must set the following environment variable (in UPPERCASE):
  632.           
  633.                GAPQBDR=PCB
  634.           
  635.           
  636.           
  637.           The following sysop functions are available while awaiting
  638.           keyboard input :
  639.           
  640.                    F5     -  Shell to DOS.
  641.                    F8     -  Twit user and return to BBS.
  642.                   F10     -  Initiate chat with user.
  643.                   CF10    -  Answer user page bell.
  644.                   Home    -  Main user stats.
  645.                   End     -  Displays sysop keys available.
  646.                   PgDn    -  Secondary user stats.
  647.                 Up Arrow  -  Increase user's time remaining.
  648.                 Dn Arrow  -  Decrease user's time remaining.
  649.           
  650.           
  651.           One of  the nicer  features about using the TWIT key, is the user
  652.           is not  told that  "the sysop  wants them  to return to the BBS".
  653.           Instead, a very plain and simple message of "returning you to the
  654.  
  655.  
  656.  
  657.  
  658.                                        Page 9
  659.  
  660.  
  661.  
  662.  
  663.  
  664.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  665.  
  666.  
  667.           BBS" is  displayed.   This way,  the user  is given no indication
  668.           that the sysop is hovering about.
  669.           
  670.           When using  the F5  shell to  DOS key,  to  return  to  the  door
  671.           program, simply  type EXIT  at the DOS command prompt.  It is not
  672.           necessary to  change directories  back  to  the  door  directory.
  673.           GAPQBDR is  smart enough  to know  which drive  and directory the
  674.           door program  is in and  will reset the defaults upon return from
  675.           DOS.
  676.           
  677.           The Up  and Down Arrow keys increase and decrease the user's time
  678.           respectively by  5 minutes for each press of the key. There is no
  679.           indication of  what is  occurring (except  by the fact the user's
  680.           time remaining  will change), so the sysop should try not to have
  681.           a lead  finger.  The increase or decrease is effective only while
  682.           the user  is in  the door.   Since we are firm believers that the
  683.           BBS system  files belong  to the BBS and should not be altered by
  684.           any door  program, updating the BBS system file is NOT automatic.
  685.           If you  wish that  any decrease or increase in the user's time be
  686.           made permanent,  you may,  after initializing  the door, call the
  687.           function that  opens the  system file.   Keep  track of  any time
  688.           credits  during  the  door  programs  operation,  then  call  the
  689.           function that updates the BBS system file.  Examples of how to do
  690.           this are included in the sample program.
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.                                        Page 10
  725.  
  726.  
  727.  
  728.  
  729.  
  730.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  731.  
  732.  
  733.                                   GLOBAL VARIABLES
  734.                                   ----------------
  735.           
  736.           All global variables (except for constants) are defined as COMMON
  737.           SHARED.   They are included in your program by including the file
  738.           GAPQBDR.BI at the top of your source file.
  739.           
  740.           
  741.           CONSTANTS
  742.           ---------
  743.           
  744.           Constants are defined as - CONST name = constant value.
  745.           
  746.           NO                  Defined as 0
  747.           YES                 Defined as 1
  748.           
  749.           ANSI CONSTANTS
  750.           --------------
  751.           
  752.           ANSI constants contain the actual ANSI color sequences.
  753.           
  754.           BLACK               ANSI codes for Black
  755.           BLUE                ANSI codes for Blue
  756.           BROWN               ANSI codes for Brown
  757.           CYAN                ANSI codes for Cyan
  758.           GREEN               ANSI codes for Green
  759.           MAGENTA             ANSI codes for Magenta
  760.           RED                 ANSI codes for Red
  761.           WHITE               ANSI codes for White
  762.           
  763.           BBLACK              ANSI codes for Grey
  764.           BBLUE               ANSI codes for bright Blue
  765.           BCYAN               ANSI codes for bright Cyan
  766.           BGREEN              ANSI codes for bright Green
  767.           BMAGENTA            ANSI codes for bright Magenta
  768.           BRED                ANSI codes for bright Red
  769.           BWHITE              ANSI codes for bright White
  770.           YELLOW              ANSI codes for Yellow
  771.           
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                        Page 11
  791.  
  792.  
  793.  
  794.  
  795.  
  796.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  797.  
  798.  
  799.           DOOR.SYS VARIABLES
  800.           ------------------
  801.           
  802.           DOOR.SYS  variables   are  initialized  while  reading  the  Door
  803.           Interface Module,  DOOR.SYS. (For PCB, PCBOARD.DAT and USERS must
  804.           be read  to initialize  these  variables).  These  variables  are
  805.           available from door start up to door end.  The DOOR.SYS variables
  806.           are the door programmer's connection to the BBS.
  807.           
  808.           
  809.           INTEGERS
  810.           --------
  811.           
  812.           alarm               Caller Alarm. 0 = off, 1 = on
  813.           baud                DTE rate to open COMM port at
  814.           bell                Page Bell. 0 = off, 1 = on
  815.           c.olor              Color toggle. 0 = no color, 1 = color ok
  816.           expert              Expert mode. 0 = non-expert, 1 = expert
  817.           l.ocal              0 = remote user, 1 = local
  818.           level               User's security level
  819.           minsleft            Number of minutes user has left at door start
  820.           node                Node number. 0 = single user
  821.           page                User's page length
  822.           parity              Should actually be data bits and is not used
  823.           port                Communications port in use
  824.           printer             Printer Toggle. 0 = off, 1 = on
  825.           s.creen             Screen display. 0 = off, 1 = on
  826.           userbaud            BPS rate of the remote user
  827.           
  828.           LONGS
  829.           -----
  830.           
  831.           downbytes           Total bytes downloaded
  832.           downloads           Number of downloads
  833.           maxbytes            Maximum number of bytes allowed to download
  834.           recnum              User's record number in USER file
  835.           timeson             Number of times user has been on
  836.           upbytes             Total bytes uploaded
  837.           uploads             Number of uploads
  838.           
  839.           STRINGS
  840.           -------
  841.           
  842.           bphone              User's business or data phone number
  843.           city                User's home town
  844.           first               User's first name
  845.           hphone              User's home phone number
  846.           last                User's last name
  847.           lastdate            Last date user was on
  848.           password            User's password. PASSWORD if sysop is on
  849.           subscrip            Date user's subscription expires
  850.           username            User's full name
  851.           
  852.           
  853.  
  854.  
  855.  
  856.                                        Page 12
  857.  
  858.  
  859.  
  860.  
  861.  
  862.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  863.  
  864.  
  865.           GAPQBDR GLOBALS
  866.           --------------
  867.           
  868.           These variables are the documented, global variables (initialized
  869.           and used  by GAPQBDR).   They  may be modified and/or used at the
  870.           programmer's discretion.
  871.           
  872.           
  873.           INTEGERS
  874.           ---------
  875.           
  876.           do.pcb              If set to 1, the BBS is a PCB system
  877.           noup                If set to 1, get.string will not uppercase
  878.           timecredit          Time credits for user (in minutes)
  879.           timeleft            Time user has left (in minutes)
  880.           
  881.           LONGS
  882.           -----
  883.           
  884.           starttime           Time the user logged on (in seconds)
  885.           temptime            For calculating keyboard time out
  886.           timenow             Time it is now  (in seconds)
  887.           
  888.           STRINGS
  889.           -------
  890.           
  891.           anystring1          Global garbage collector
  892.           bbs.dir             Path to BBS default dir
  893.           board.name          Name of the BBS
  894.           gendir              Path to the gen directory
  895.           maindir             Path to the main directory
  896.           sysname             Sysop's name
  897.           
  898.           
  899.           GAPDOS.DAT VARIABLES
  900.           --------------------
  901.           
  902.           These variables  are initialized  by the  programmer by  making a
  903.           call to read.gapdos.  Note that string variables are fixed length
  904.           and will  contain a NULL byte.  Please see the GAPQBDR.BI include
  905.           file for the actual definition of these variables.
  906.           
  907.           
  908.           gapdos.baud         DTE bps rate
  909.           gapdos.callbytes    Ttl bytes available for download
  910.           gapdos.didnew       1 = did a new files scan
  911.           gapdos.exitdos      1 = exit to DOS after call
  912.           gapdos.forumnum     Forum the user is in
  913.           gapdos.givetime     1 = event pending, else extra time received
  914.           gapdos.joined       Bit flags of forums joined
  915.           gapdos.localc       0 = user, 1 = sysop, 2 = local user
  916.           gapdos.minavail     Total minutes available to user
  917.           gapdos.port         Port being used
  918.           gapdos.starttime    Time (in seconds) user logged on
  919.  
  920.  
  921.  
  922.                                        Page 13
  923.  
  924.  
  925.  
  926.  
  927.  
  928.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  929.  
  930.  
  931.           gapdos.timecredit   Any time credits user may have
  932.           gapdos.userbaud     User's bps rate
  933.           gapdos.userfirst    User's first name
  934.           gapdos.userindex    User's index into user file
  935.           gapdos.username     User's full name
  936.           
  937.           
  938.           USERS.DAT VARIABLES
  939.           -------------------
  940.           
  941.           These variables  are initialized  by the  programmer by  making a
  942.           call to  read.gapuser.   Note that  string  variables  are  fixed
  943.           length and  will contain  a NULL byte.  Please see the GAPQBDR.BI
  944.           include file for the actual definition of these variables.
  945.           
  946.           WARNING : STRING fields are fully padded with spaces and the last
  947.           position of the string is and MUST be a 0!
  948.           
  949.           user.blts           Total bulletins read
  950.           user.bphone         User's work or data phone number
  951.           user.city           City, state, and zip (padded)
  952.           user.curbytes       Total bytes downloaded this call
  953.           user.curdown        Total files dowloaded today
  954.           user.doors          Total doors opened
  955.           user.downloads      Total downloads
  956.           user.expert         Novice = N, expert = Y
  957.           user.fname          User's first name (padded)
  958.           user.handle         User's handle (padded)
  959.           user.hphone         User's home phone number
  960.           user.joined         Total forums joined
  961.           user.lastdate       Last date on - mm/dd/yy
  962.           user.lastdir        Date last looked at a directory listing
  963.           user.lastfrm        Last forum in
  964.           user.lastmsg        Last message read
  965.           user.lasttime       Last time on - hh:mm
  966.           user.level          Security Level
  967.           user.lname          User's last name (padded)
  968.           user.mesleft        Total messages left
  969.           user.mesread        Total messages read
  970.           user.minutes        Total minutes last call
  971.           user.page           Page length
  972.           user.passwd         User's password (padded)
  973.           user.private        Allow on private nodes?
  974.           user.protocol       Transfer protocol (padded)
  975.           user.subscribe      Date user's subscription expires
  976.           user.sysop          Sysop record, 1 = Y, 0 = N
  977.           user.timeson        Number of times on
  978.           user.ttlbytes       Total bytes downloaded
  979.           user.ttlmins        Total mins on
  980.           user.upbytes        Total bytes uploaded
  981.           user.uploads        Total uploads
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                                        Page 14
  989.  
  990.  
  991.  
  992.  
  993.  
  994.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  995.  
  996.  
  997.           PCBOARD.SYS VARIABLES
  998.           --------------------
  999.           
  1000.           These variables are initialized automatically by init.door if the
  1001.           BBS system is PCB (set by environment variable GAPQBDR=PCB).
  1002.           
  1003.           
  1004.           pcbsys.baud         Com port bps rate
  1005.           pcbsys.calleralarm  Caller alarm   -1=on,0=off
  1006.           pcbsys.colorc       Color toggle   Y,N,7
  1007.           pcbsys.ctime        Time user logged on as HH:MM
  1008.           pcbsys.display      Display on/off -1=on,0=off
  1009.           pcbsys.eactive      Event active   -1=yes,0=no
  1010.           pcbsys.errcorrect   ECC modem      -1=yes,0=no
  1011.           pcbsys.event        Event time as HH:MM
  1012.           pcbsys.forumnum     Forum user was in  "0" = main
  1013.           pcbsys.minsleft     Minutes left for caller
  1014.           pcbsys.node         Node number as short integer
  1015.           pcbsys.pagebell     Page bell      -1=on,0=off
  1016.           pcbsys.password     User's password
  1017.           pcbsys.port         Com port as "0","1", or "2"
  1018.           pcbsys.printer      Printer on/off -1=on,0=off
  1019.           pcbsys.sevent       Slide event    -1=yes,0=no
  1020.           pcbsys.sysopnext    Sysop on next  N,X,space
  1021.           pcbsys.timeallowed  Allowed time in minutes
  1022.           pcbsys.timecredit   Any time credits in minutes
  1023.           pcbsys.timegiven    Highest forum time given
  1024.           pcbsys.timeon       Time user logged on in minutes
  1025.           pcbsys.timeused     Time user has used that day
  1026.           pcbsys.ttlbytes     Total K bytes available
  1027.           pcbsys.userbaud     Caller bps rate (Local if local mode)
  1028.           pcbsys.userfirst    User's first name
  1029.           pcbsys.username     Name of caller
  1030.           pcbsys.userrec      User's record number
  1031.           
  1032.           
  1033.           PCB USERS VARIABLES
  1034.           -------------------
  1035.           
  1036.           These variables are initialized automatically by init.door if the
  1037.           BBS system  is PCB (set by environment variable GAPQBDR=PCB).  To
  1038.           utilize downbytes,  upbytes, and  lastmsg you  must  use  the  QB
  1039.           Microsoft Binary Format conversion functions.
  1040.           
  1041.           
  1042.           pcbuser.bphone      User's work or data phone number
  1043.           pcbuser.city        City, state, and zip (padded)
  1044.           pcbuser.cnfregis    Forum registration
  1045.           pcbuser.delete      Delete, Y=yes,N=no
  1046.           pcbuser.downbytes   Total download bytes. Use CVDMBF
  1047.           pcbuser.downloads   Number of downloads
  1048.           pcbuser.expert      Expert mode Y=yes,N=no
  1049.           pcbuser.hphone      User's home phone
  1050.           pcbuser.lastconf    Last forum in
  1051.  
  1052.  
  1053.  
  1054.                                        Page 15
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1061.  
  1062.  
  1063.           pcbuser.lastdate    Last date user was on
  1064.           pcbuser.lastdir     Last New files scan
  1065.           pcbuser.lastime     Last time user was on
  1066.           pcbuser.lastmsg     Last message read in main. Use CVSMBF
  1067.           pcbuser.lastmsg1    Last message read in each forum
  1068.           pcbuser.level       User's level as short integer
  1069.           pcbuser.name        User's name
  1070.           pcbuser.page        Page length
  1071.           pcbuser.passwd      User's password
  1072.           pcbuser.protocol    Protocol type
  1073.           pcbuser.regisdate   Registration date
  1074.           pcbuser.timeson     Number of times on
  1075.           pcbuser.upbytes     Total upload bytes. Use CVDMBF
  1076.           pcbuser.uploads     Number of uploads
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                                        Page 16
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1127.  
  1128.  
  1129.                       GLOBAL VARIABLES - ALPHABETICALLY By Type
  1130.                       -----------------------------------------
  1131.           
  1132.           CONSTANTS
  1133.           ---------
  1134.           
  1135.           BBLACK              ANSI codes for Grey
  1136.           BBLUE               ANSI codes for bright Blue
  1137.           BCYAN               ANSI codes for bright Cyan
  1138.           BGREEN              ANSI codes for bright Green
  1139.           BLACK               ANSI codes for Black
  1140.           BLUE                ANSI codes for Blue
  1141.           BMAGENTA            ANSI codes for bright Magenta
  1142.           BRED                ANSI codes for bright Red
  1143.           BROWN               ANSI codes for Brown
  1144.           BWHITE              ANSI codes for bright White
  1145.           CYAN                ANSI codes for Cyan
  1146.           GREEN               ANSI codes for Green
  1147.           MAGENTA             ANSI codes for Magenta
  1148.           NO                  Defined as 0
  1149.           RED                 ANSI codes for Red
  1150.           WHITE               ANSI codes for White
  1151.           YELLOW              ANSI codes for Yellow
  1152.           YES                 Defined as 1
  1153.           
  1154.           INTEGERS
  1155.           --------
  1156.           
  1157.           alarm               Caller Alarm. 0 = off, 1 = on
  1158.           baud                DTE rate to open COMM port at
  1159.           bell                Page Bell. 0 = off, 1 = on
  1160.           c.olor              Color toggle. 0 = no color, 1 = color ok
  1161.           do.pcb              1 = This is a PCB system
  1162.           expert              Expert mode. 0 = non-expert, 1 = expert
  1163.           gapdos.baud         DTE bps rate
  1164.           gapdos.forumnum     Forum the user is in
  1165.           gapdos.givetime     1 = event pending, else extra time received
  1166.           gapdos.localc       0 = user, 1 = sysop, 2 = local user
  1167.           gapdos.minavail     Total minutes available to user
  1168.           gapdos.port         Port being used
  1169.           gapdos.timecredit   Any time credits user may have
  1170.           gapdos.userbaud     User's bps rate
  1171.           l.ocal              0 = remote user, 1 = local
  1172.           level               User's security level
  1173.           minsleft            Number of minutes user has left at door start
  1174.           node                Node number. 0 = single user
  1175.           noup                1 = get.string will not uppercase
  1176.           page                User's page length
  1177.           parity              Should actually be data bits and is not used
  1178.           pcbsys.minsleft     Minutes left for caller
  1179.           pcbsys.timeallowed  Allowed time in minutes
  1180.           pcbsys.timecredit   Any time credits in minutes
  1181.           pcbsys.timegiven    Highest forum time given
  1182.           pcbsys.timeon       Time user logged on in minutes
  1183.  
  1184.  
  1185.  
  1186.                                        Page 17
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1193.  
  1194.  
  1195.           pcbsys.timeused     Time user has used that day
  1196.           pcbsys.ttlbytes     Total K bytes available
  1197.           pcbsys.userrec      User's record number
  1198.           pcbuser.downbytes   Total download bytes. Use CVDMBF
  1199.           pcbuser.timeson     Number of times on
  1200.           pcbuser.uploads     Number of uploads
  1201.           port                Communications port in use
  1202.           printer             Printer Toggle. 0 = off, 1 = on
  1203.           s.creen             Screen display. 0 = off, 1 = on
  1204.           timecredit          Time credits for user (in minutes)
  1205.           timeleft            Time user has left (in minutes)
  1206.           user.curdown        Total files dowloaded today
  1207.           user.lastfrm        Last forum in
  1208.           user.level          Security Level
  1209.           user.minutes        Total minutes last call
  1210.           user.page           Page length
  1211.           userbaud            BPS rate of the remote user
  1212.           
  1213.           LONGS
  1214.           -----
  1215.           
  1216.           downbytes           Total bytes downloaded
  1217.           downloads           Number of downloads
  1218.           gapdos.callbytes    Ttl bytes available for download
  1219.           gapdos.joined       Bit flags of forums joined
  1220.           gapdos.starttime    Time (in seconds) user logged on
  1221.           maxbytes            Maximum number of bytes allowed to download
  1222.           recnum              User's record number in USER file
  1223.           starttime           Time the user logged on (in seconds)
  1224.           temptime            For calculating keyboard time out
  1225.           timenow             Time it is now  (in seconds)
  1226.           timeson             Number of times user has been on
  1227.           upbytes             Total bytes uploaded
  1228.           uploads             Number of uploads
  1229.           user.blts           Total bulletins read
  1230.           user.curbytes       Total bytes downloaded this call
  1231.           user.doors          Total doors opened
  1232.           user.downloads      Total downloads
  1233.           user.joined         Total forums joined
  1234.           user.lastmsg        Last message read
  1235.           user.mesleft        Total messages left
  1236.           user.mesread        Total messages read
  1237.           user.timeson        Number of times on
  1238.           user.ttlbytes       Total bytes downloaded
  1239.           user.ttlmins        Total mins on
  1240.           user.upbytes        Total bytes uploaded
  1241.           user.uploads        Total uploads
  1242.           
  1243.           STRINGS
  1244.           -------
  1245.           
  1246.           anystring1          garbage collector
  1247.           bbs.dir             Path to BBS default dir
  1248.           board.name          Name of the BBS
  1249.  
  1250.  
  1251.  
  1252.                                        Page 18
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1259.  
  1260.  
  1261.           bphone              User's business or data phone number
  1262.           city                User's home town
  1263.           first               User's first name
  1264.           gapdos.didnew       1 = did a new files scan
  1265.           gapdos.exitdos      1 = exit to DOS after call
  1266.           gapdos.userfirst    User's first name
  1267.           gapdos.userindex    User's index into user file
  1268.           gapdos.username     User's full name
  1269.           gendir              Path to the gen directory
  1270.           hphone              User's home phone number
  1271.           last                User's last name
  1272.           lastdate            Last date user was on
  1273.           maindir             Path to the main directory
  1274.           password            User's password. PASSWORD if sysop is on
  1275.           pcbsys.baud         Com port bps rate
  1276.           pcbsys.calleralarm  Caller alarm   -1=on,0=off
  1277.           pcbsys.colorc       Color toggle   Y,N,7
  1278.           pcbsys.ctime        Time user logged on as HH:MM
  1279.           pcbsys.display      Display on/off -1=on,0=off
  1280.           pcbsys.eactive      Event active   -1=yes,0=no
  1281.           pcbsys.errcorrect   ECC modem      -1=yes,0=no
  1282.           pcbsys.event        Event time as HH:MM
  1283.           pcbsys.forumnum     Forum user was in  "0" = main
  1284.           pcbsys.node         Node number as short integer
  1285.           pcbsys.pagebell     Page bell      -1=on,0=off
  1286.           pcbsys.password     User's password
  1287.           pcbsys.port         Com port as "0","1", or "2"
  1288.           pcbsys.printer      Printer on/off -1=on,0=off
  1289.           pcbsys.sevent       Slide event    -1=yes,0=no
  1290.           pcbsys.sysopnext    Sysop on next  N,X,space
  1291.           pcbsys.userbaud     Caller bps rate (Local if local mode)
  1292.           pcbsys.userfirst    User's first name
  1293.           pcbsys.username     Name of caller
  1294.           pcbuser.bphone      User's work or data phone number
  1295.           pcbuser.city        City, state, and zip
  1296.           pcbuser.cnfregis    Forum registration
  1297.           pcbuser.delete      Delete, Y=yes,N=no
  1298.           pcbuser.downloads   Number of downloads
  1299.           pcbuser.expert      Expert mode Y=yes,N=no
  1300.           pcbuser.hphone      User's home phone
  1301.           pcbuser.lastconf    Last forum in
  1302.           pcbuser.lastdate    Last date user was on
  1303.           pcbuser.lastdir     Last New files scan
  1304.           pcbuser.lastime     Last time user was on
  1305.           pcbuser.lastmsg     Last message read in main. Use CVSMBF
  1306.           pcbuser.lastmsg1    Last message read in each forum
  1307.           pcbuser.level       User's level as short integer
  1308.           pcbuser.name        User's name
  1309.           pcbuser.page        Page length
  1310.           pcbuser.passwd      User's password
  1311.           pcbuser.protocol    Protocol type
  1312.           pcbuser.regisdate   Registration date
  1313.           pcbuser.upbytes     Total upload bytes. Use CVDMBF
  1314.           subscrip            Date user's subscription expires
  1315.  
  1316.  
  1317.  
  1318.                                        Page 19
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1325.  
  1326.  
  1327.           sysname             Sysop's name
  1328.           user.bphone         User's work or data phone number
  1329.           user.city           City, state, and zip (padded)
  1330.           user.expert         Novice = N, expert = Y
  1331.           user.fname          User's first name (padded)
  1332.           user.handle         User's handle (padded)
  1333.           user.hphone         User's home phone number
  1334.           user.lastdate       Last date on - mm/dd/yy
  1335.           user.lastdir        Date last looked at a directory listing
  1336.           user.lasttime       Last time on - hh:mm
  1337.           user.lname          User's last name (padded)
  1338.           user.passwd         User's password (padded)
  1339.           user.private        Allow on private nodes?
  1340.           user.protocol       Transfer protocol (padded)
  1341.           user.subscribe      Date user's subscription expires
  1342.           user.sysop          Sysop record, 1 = Y, 0 = N
  1343.           username            User's full name
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                                        Page 20
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1391.  
  1392.  
  1393.                      FUNCTIONS AND SUBROUTINES - QUICK REFERENCE
  1394.                      -------------------------------------------
  1395.           
  1396.           a.ccess%            Checks for the existence of a file.
  1397.           ansi                Displays ANSI escape sequences.
  1398.           backspace           Sends one or more backspaces.
  1399.           ckeypress%          Checks for a remote or local key press.
  1400.           clear.scr           Clears the local and remote screens
  1401.           do.chat             To allow sysop to chat with remote user.
  1402.           elap.time           Computes elapsed time.
  1403.           get.string          Gets a string of characters.
  1404.           get.time&           Returns number of seconds since 01/01/70.
  1405.           getakey%            Gets one key responses.
  1406.           getrand%            Returns a random number.
  1407.           init.door           Initializes the Door.
  1408.           leave               Shuts down door and returns to the BBS.
  1409.           more                Checks for a full screen.
  1410.           nl                  Sends a CR/LF to local and remote.
  1411.           no.carrier          Prints a message if carrier lost.
  1412.           open.gap%           Opens and reads GAPBBS.CNF.
  1413.           pagesysop           Alerts sysop that the user wants to chat.
  1414.           pause               Sends a "Press [Any Key] To Continue" prompt.
  1415.           putachar            Sends a single character.
  1416.           putkey              Used by chat for word wrapping.
  1417.           read.cnf            Reads the door configuration file.
  1418.           read.doorsys%       Reads DOOR.SYS.
  1419.           read.gapdos%        Reads GAPDOS.DAT.
  1420.           read.gapuser%       Reads USERS.DAT.
  1421.           read.pcbsys%        Reads PCBOARD.SYS.
  1422.           read.pcbuser%       Reads PCB USERS file.
  1423.           right.trim$         Trims spaces from string.
  1424.           set.status          Displays status line.
  1425.           show.file           Displays text files.
  1426.           show.mess           Displays a message.
  1427.           time.credit         Gives credits for time used.
  1428.           time.left           Computes time remaining.
  1429.           update.clock        Updates status line clock.
  1430.           waitasec            Pauses for x number of seconds.
  1431.           wrap.word           Wraps a word.
  1432.           write.gapdos%       Writes GAPDOS.DAT.
  1433.           write.gapuser%      Writes USERS.DAT.
  1434.           write.pcbsys%       Writes PCBOARD.SYS.
  1435.           write.pcbuser%      Writes PCB USERS.
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                        Page 21
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1457.  
  1458.  
  1459.                         FUNCTIONS AND SUBROUTINES - REFERENCE
  1460.                         -------------------------------------
  1461.           
  1462.           Functions always return a value.  The type of the return value is
  1463.           denoted by  the type  modifier after a function name.  The return
  1464.           value should  be assigned  to a  variable of  the same  type. For
  1465.           instance, the  function get.time&  returns a long integer. To re-
  1466.           trieve the return value, assign it to an long integer as :
  1467.           
  1468.                long.int& = get.time&
  1469.           
  1470.           Subroutines do not return a value.  To call a subroutine, use the
  1471.           Basic CALL function :
  1472.           
  1473.                call get.string
  1474.           
  1475.           
  1476.           
  1477.           
  1478.                   Name :  a.ccess%
  1479.                Purpose :  Checks for the existence of a file.
  1480.             Parameters :  Full path and name of file
  1481.           Return Value :  0 = file was found, 1 = file not found
  1482.           
  1483.            Description :  In order to avoid Basic errors that occur when
  1484.                           trying to open a file that does not exist, this
  1485.                           function should be used prior to opening any
  1486.                           file.
  1487.           
  1488.                Example :  r% = access%("GAPQBDR.DOC")
  1489.                           if r% <> 0 then
  1490.                              print "Cannot Find GAPQBDR.DOC"
  1491.                           end if
  1492.           
  1493.           
  1494.                   Name :  ansi
  1495.                Purpose :  Displays ANSI escape sequences
  1496.             Parameters :  ANSI color to display
  1497.           Return Value :  None
  1498.           
  1499.            Description :  This function will send a string of ANSI escape
  1500.                           sequences to the remote user and to the local
  1501.                           console.  The ANSI codes for the various colors
  1502.                           are defined as constants in the GAPQBDR.BI file.
  1503.                           If the remote or local user is in non graphics
  1504.                           mode, the function returns immediately.
  1505.           
  1506.                Example :  call ansi(BWHITE)
  1507.           
  1508.           
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.                                        Page 22
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1523.  
  1524.  
  1525.                   Name :  backspace
  1526.                Purpose :  Sends one or more backspaces
  1527.             Parameters :  Number of backspaces to send
  1528.           Return Value :  None
  1529.           
  1530.            Description :  In order to actually erase a character on the
  1531.                           screen, you must send a 3 character sequence
  1532.                           which consists of backspace, space, backspace.
  1533.                           This function will send as many of these 3 char-
  1534.                           acter sequences as you specify in the parameter
  1535.                           list.
  1536.           
  1537.                Example :  call backspace(1)
  1538.                           str$ = "Press Any Key "        ' set up string
  1539.                           call show.mess(str$,NO,NO)     ' show string
  1540.                           c% = getkeyc%                  ' get a key
  1541.                           call backspace(len(str$))      ' erase string
  1542.           
  1543.           
  1544.                   Name :  ckeypress%
  1545.                Purpose :  Checks for a remote or local key press
  1546.             Parameters :  None
  1547.           Return Value :  0 = no key is waiting, 1 = a key is waiting
  1548.           
  1549.            Description :  This function will check the local keyboard as
  1550.                           well as the communications receive buffer to see
  1551.                           if a key is waiting to be read.  It is most often
  1552.                           used in loops that need to receive a 1 character
  1553.                           keystroke.
  1554.           
  1555.                Example :  c% = ckeypress%                ' key pressed?
  1556.                           
  1557.                           c% = 0                         ' initialize
  1558.                           do
  1559.                              |                           ' do something
  1560.                              |
  1561.                              c% = ckeypress%             ' key pressed?
  1562.                           until c% <> 0                  ' key pressed,exit
  1563.           
  1564.           
  1565.                   Name :  clear.scr
  1566.                Purpose :  Clears local and remote screens.
  1567.             Parameters :  None
  1568.           Return Value :  None
  1569.           
  1570.            Description :  This routine will use the Basic CLS 2 statement
  1571.                           to clear the local screen.  If the remote caller
  1572.                           is in non-color mode, it sends a CHR$(12) to the
  1573.                           remote screen, otherwise it sends the ANSI clear
  1574.                           screen sequence.
  1575.           
  1576.                Example :  call clear.scr                 ' clear screen
  1577.           
  1578.           
  1579.  
  1580.  
  1581.  
  1582.                                        Page 23
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1589.  
  1590.  
  1591.                   Name :  do.chat
  1592.                Purpose :  To allow sysop to chat with remote user
  1593.             Parameters :  None
  1594.           Return Value :  None
  1595.           
  1596.            Description :  This function allows a one on one chat with a re-
  1597.                           mote user.  If the caller is in graphics mode,
  1598.                           the sysop's key presses will be displayed in
  1599.                           green and the remote user's key presses will be
  1600.                           displayed in white. Text will automatically wrap
  1601.                           at column 76.  To exit chat, press either the ESC
  1602.                           key or type a CTRL-X.  Note that the user may
  1603.                           also send these characters to end chat. The user
  1604.                           will receive full credit for the time spent chat-
  1605.                           ting with the sysop.  However, this function will
  1606.                           not update the BBS system file so it is possible
  1607.                           that the user may be logged off (with an out of
  1608.                           time message) when he/she returns to the BBS.
  1609.           
  1610.                Example :  call do.chat
  1611.                           
  1612.                           response$ = " "                ' initialize
  1613.                           call get.string(response$)     ' get a string
  1614.                           if response$ = "P" then        ' paging sysop
  1615.                              call do.chat                ' chat with sysop
  1616.                           end if
  1617.           
  1618.           
  1619.                   Name :  elap.time
  1620.                Purpose :  Computes elapsed time while waiting for keyboard
  1621.                           input
  1622.             Parameters :  None
  1623.           Return Value :  None
  1624.           
  1625.            Description :  This function is used in loops that await a key-
  1626.                           board response.  Prior to entering the loop, the
  1627.                           variable called temptime should be initialized
  1628.                           with the current time. Once inside the loop, this
  1629.                           function should be called to keep track of the
  1630.                           elapsed time. If there is no keyboard response
  1631.                           within 4 minutes, the user will be logged off.
  1632.           
  1633.                Example :  call elap.time
  1634.                           
  1635.                           temptime& = get.time&          ' start timer
  1636.                           do
  1637.                              gc = getakey%               ' get a key
  1638.                              if gc <> 0 then             ' key pressed
  1639.                                 exit do                  ' exit and process
  1640.                              end if
  1641.                              call elap.time              ' activity?
  1642.                           loop                           ' continue
  1643.           
  1644.           
  1645.  
  1646.  
  1647.  
  1648.                                        Page 24
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1655.  
  1656.  
  1657.                   Name :  get.string
  1658.                Purpose :  Gets a string of characters
  1659.             Parameters :  String to fill
  1660.           Return Value :  None
  1661.           
  1662.            Description :  This is the main input routine.  It will get a
  1663.                           string from either the remote user or the local
  1664.                           keyboard.  The string passed will be set to the
  1665.                           characters received. The length of the input
  1666.                           string is determined by the length of the string
  1667.                           passed. Do not pass a fixed length string to this
  1668.                           routine.
  1669.                           
  1670.                           Before calling, you must initialize the passed
  1671.                           string with spaces.  The number of spaces in the
  1672.                           string determines the number of characters al-
  1673.                           lowed to be input. If a user attempts to type
  1674.                           more characters than allowed, the cursor will not
  1675.                           move pass the end of the string.  Input ends when
  1676.                           the Enter key is pressed.
  1677.                           
  1678.                           To initialize the string, use the Basic space$
  1679.                           function (IE, input$ = space$(10) - initializes
  1680.                           input$ to 10 spaces).
  1681.                           
  1682.                           WARNING : It is extremely important that the
  1683.                           passed string be initialized.  Failure to set the
  1684.                           string to spaces, will cause unpredictable
  1685.                           results!
  1686.                           
  1687.                           This function does not return a new string con-
  1688.                           taining the keyboard input.  Instead, it modifies
  1689.                           the string you pass to it in the parameter list.
  1690.                           The string will be stripped of any trailing
  1691.                           spaces.
  1692.                           
  1693.                           get.string automatically uppercases the string.
  1694.                           If you wish to disable this feature, set the
  1695.                           variable noup to 1.
  1696.                           
  1697.                           get.string will automatically check for keyboard
  1698.                           activity so it is not necessary for you to do so.
  1699.           
  1700.                Example :  instr$ = space$(10)              ' initialize
  1701.                           call get.string(instr$)          ' get string
  1702.           
  1703.           
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                                        Page 25
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1721.  
  1722.  
  1723.                   Name :  get.time&
  1724.                Purpose :  Gets the number of seconds elapsed since 01/01/70
  1725.             Parameters :  None
  1726.           Return Value :  Number of seconds since 01/01/70
  1727.           
  1728.            Description :  This routine is equivalent to the C time() func-
  1729.                           tion. It is used throughout the GAPQBDR module to
  1730.                           compute various times.  This function is not sus-
  1731.                           ceptible to the midnight roll over problem so
  1732.                           prevalent in Basic communications programs.
  1733.                           
  1734.                           Note that the return value is of type LONG.  You
  1735.                           must cast the return value to a LONG INTEGER or
  1736.                           loss of significant digits will result.
  1737.           
  1738.                Example :  dim ltime as long              ' declare as long
  1739.                           ltime = get.time&              ' get the time
  1740.                           
  1741.                           ' if you don't like declaring variables, you can
  1742.                           ' do it the old fashioned way
  1743.                           
  1744.                           longtime& = get.time&           ' get the time
  1745.           
  1746.           
  1747.                   Name :  getakey%
  1748.                Purpose :  Gets one key responses
  1749.             Parameters :  None
  1750.           Return Value :  ASCII code for the key pressed or 0
  1751.           
  1752.            Description :  This is the main keyboard input routine
  1753.                           (internal). It is called by get.string as well as
  1754.                           any keyboard polling loops.  It checks the re-
  1755.                           ceive buffer as well as the local keyboard for a
  1756.                           key press.  If one is not found it returns 0.
  1757.                           The character input is not echoed. Since 99% of
  1758.                           all keyboard input comes from this routine, it
  1759.                           checks for carrier, time remaining, keyboard
  1760.                           time-out, as well as special sysop function keys.
  1761.                           The "timeleft" variable is updated via this rou-
  1762.                           tine.  This is the variable you would normally
  1763.                           use in a prompt such as,
  1764.                           
  1765.                               [20 mins left] Main Command :
  1766.           
  1767.                Example :  c% = getakey
  1768.           
  1769.           
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                                        Page 26
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1787.  
  1788.  
  1789.                   Name :  getrand%
  1790.                Purpose :  Gets a random number
  1791.             Parameters :  Low number, high number
  1792.           Return Value :  A random number
  1793.           
  1794.            Description :  This routine is provided because it is much
  1795.                           easier to use and understand than Basic's random
  1796.                           function.  Provide as parameters two integers.
  1797.                           The first parameter is the lowest number you will
  1798.                           accept as a random number, and the second parame-
  1799.                           ter is the highest random number you will accept.
  1800.                           The function will return a random integer between
  1801.                           the range specified (low and high are included in
  1802.                           the range of numbers).  It is not necessary to
  1803.                           seed the random number generator as this is done
  1804.                           automatically for you during program
  1805.                           initialization.
  1806.           
  1807.                Example :  rndnum% = getrand% (1,10)      ' get a random
  1808.                                                          ' number between 1
  1809.                                                          ' and 10
  1810.           
  1811.           
  1812.                   Name :  init.door
  1813.                Purpose :  Initializes the GAPQBDR functions
  1814.             Parameters :  None
  1815.           Return Value :  None
  1816.           
  1817.            Description :  This routine must be called immediately after
  1818.                           calling read.cnf.  It initializes the door, opens
  1819.                           and reads system files, initializes the comm
  1820.                           port, initializes global variables and in gen-
  1821.                           eral, makes sure that all of the files required
  1822.                           for operation are present. There is no return
  1823.                           value.  If an error occurs while trying to ini-
  1824.                           tialize, the function will display an error mes-
  1825.                           sage and end the program.
  1826.           
  1827.                Example :  call read.cnf("DOOR.CFG")      ' read config file
  1828.                           call init.door                 ' init the door
  1829.           
  1830.           
  1831.                   Name :  leave
  1832.                Purpose :  Exits the program
  1833.             Parameters :  None
  1834.           Return Value :  None
  1835.           
  1836.            Description :  When the program terminates, it must call this
  1837.                           function to end.  This is the ONLY proper exit
  1838.                           from the door.
  1839.           
  1840.                Example :  call leave
  1841.           
  1842.           
  1843.  
  1844.  
  1845.  
  1846.                                        Page 27
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1853.  
  1854.  
  1855.                   Name :  more
  1856.                Purpose :  Checks for a full screen and issues a More Prompt
  1857.             Parameters :  None
  1858.           Return Value :  None
  1859.           
  1860.            Description :  This is an internal routine that is called by the
  1861.                           character output functions.
  1862.           
  1863.                Example :
  1864.           
  1865.           
  1866.                   Name :  nl
  1867.                Purpose :  To send a Carriage Return and Line Feed to local
  1868.                           and remote
  1869.             Parameters :  Number of New Line's to send
  1870.           Return Value :  None
  1871.           
  1872.            Description :  To send a blank line, call this routine with the
  1873.                           number of blank lines you wish to send.
  1874.           
  1875.                Example :  call nl(2)                     ' send two blank
  1876.                                                          ' lines
  1877.           
  1878.           
  1879.                   Name :  no.carrier
  1880.                Purpose :  Prints a message and calls leave()
  1881.             Parameters :  None
  1882.           Return Value :  None
  1883.           
  1884.            Description :  Internal routine that is called when there is a
  1885.                           loss of carrier.  Displays a message to the local
  1886.                           screen and then calls leave to terminate the
  1887.                           program.
  1888.                           
  1889.                           If you have a routine that checks for carrier and
  1890.                           you wish to display the standard "No Carrier"
  1891.                           message and log the user off, call this function.
  1892.           
  1893.                Example :  call no.carrier
  1894.           
  1895.           
  1896.                   Name :  open.gap%
  1897.                Purpose :  Opens and reads the GAPBBS.CNF file
  1898.             Parameters :  None
  1899.           Return Value :  0 = no error, 1 = error
  1900.           
  1901.            Description :  This function is called by init.door.  It opens
  1902.                           and reads the configuration file for GAP.  Note
  1903.                           that only part of the CNF file is read.  The main
  1904.                           purpose for reading the file is to obtain the
  1905.                           path to the BBS's main directory and get the
  1906.                           sysop' name.
  1907.           
  1908.                Example :  c% = open.gap%
  1909.  
  1910.  
  1911.  
  1912.                                        Page 28
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1919.  
  1920.  
  1921.                   Name :  pagesysop
  1922.                Purpose :  Alerts sysop that user wants to chat
  1923.             Parameters :  None
  1924.           Return Value :  None
  1925.           
  1926.             Description : Allows the programer to provide the user with a
  1927.                           Page Sysop command.  The page lasts for 30
  1928.                           seconds and can be aborted by typing CTRL K. If
  1929.                           the sysop's page bell is on, the sysop's speaker
  1930.                           will also sound.  To answer the page, the sysop
  1931.                           should press CTRL F10.
  1932.           
  1933.                Example :  response$ = " "                ' initialize var
  1934.                           call get.string(response$)     ' wait for a key
  1935.                           if response$ = "P" then        ' wants to chat
  1936.                              call pagesysop              ' tell sysop
  1937.                           end if
  1938.           
  1939.           
  1940.                   Name :  pause
  1941.                Purpose :  Sends a "Press [Any Key] To Continue" prompt
  1942.             Parameters :  None
  1943.           Return Value :  None
  1944.           
  1945.             Description : This function sends a pause prompt and waits for
  1946.                           a key press.
  1947.           
  1948.                Example :  call nl(1)                     ' send blank line
  1949.                           call pause                     ' wait for a key
  1950.           
  1951.           
  1952.                   Name :  putachar
  1953.                Purpose :  Send a single character to local and remote
  1954.             Parameters :  ASCII character to send
  1955.           Return Value :  None
  1956.           
  1957.            Description :  This routine is called a "semi-unfiltered" char-
  1958.                           acter output routine because it allows for most
  1959.                           ASCII characters to be output.
  1960.           
  1961.                Example :  c% = ASC("A")                  ' send an 'A'
  1962.                           call putachar(c%)              ' to local and
  1963.                                                          ' remote screen
  1964.                           
  1965.                           c% = getakey%                  ' get a keypress
  1966.                           if (c% <> 0 then               ' if we got a key
  1967.                              call putachar(c%)           ' display the
  1968.                           end if                         ' character
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                        Page 29
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  1985.  
  1986.  
  1987.                   Name :  putkey
  1988.                Purpose :  Used by chat routines to keep track of word
  1989.                           wrapping
  1990.             Parameters :  Character to send
  1991.           Return Value :  None
  1992.           
  1993.            Description :  This is the main output routine for the chat
  1994.                           functions. It keeps track of the current column,
  1995.                           and decides when it is time to wrap a word.  It
  1996.                           should not be called by the programmer's routines
  1997.                           since putachar is faster and more efficient.
  1998.           
  1999.                Example :
  2000.           
  2001.           
  2002.                   Name :  read.cnf
  2003.                Purpose :  To read the door configuration file
  2004.             Parameters :  Full path and file name to the configuration
  2005.                           file.
  2006.           Return Value :  None
  2007.           
  2008.            Description :  Opens the configuration file for the current
  2009.                           door. Normally the passed parameter is the name
  2010.                           of the door with a .CNF extension (it is assumed
  2011.                           that the file is in the same directory as the
  2012.                           door program). If an error occurs, the program
  2013.                           ends immediately.
  2014.                           
  2015.                           WARNING : The first two lines of this configura-
  2016.                           tion file belong to the GAPQBDR interface module.
  2017.                           You are free to use the information, but the in-
  2018.                           formation contained in the first two lines must
  2019.                           conform exactly to the following specifications.
  2020.                           
  2021.                           The first line of this file is the full drive and
  2022.                           path to the BBS default directory.  This is the
  2023.                           directory where the BBS system files can be found
  2024.                           (IE, GAPDOS.DAT, DOOR.SYS, GAPBBS.CNF).  The en-
  2025.                           try on line 1 is not checked until init.door is
  2026.                           called.
  2027.                           
  2028.                           The second line of this file is the name of the
  2029.                           BBS.
  2030.                           
  2031.                           It is the responsibility of the door author to
  2032.                           describe the format of these two lines to the end
  2033.                           user.  It is also the responsibility of the door
  2034.                           author to insure that the end user have these two
  2035.                           lines in the door configuration file.  If your
  2036.                           door program requires no configuration parameters
  2037.                           of its own, you can simply distribute a sample
  2038.                           "door".cnf file with these two lines already in
  2039.                           it.
  2040.                           
  2041.  
  2042.  
  2043.  
  2044.                                        Page 30
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2051.  
  2052.  
  2053.                           GAPQBDR will NOT close this file (file #1) after
  2054.                           reading the first two lines.  It leaves the file
  2055.                           open for the programmer's use.  If your door does
  2056.                           require certain configuration parameters, have
  2057.                           your users place the parameters in the file
  2058.                           starting with line 3.  If you use a set up pro-
  2059.                           gram, be sure that your set up program writes the
  2060.                           first two lines as specified.
  2061.                           
  2062.                           After you have called read.cnf and init.door, if
  2063.                           you have any configuration options in the
  2064.                           "door".cnf file, you should line input those op-
  2065.                           tions.  Then close file #1.  Even if you have no
  2066.                           options to read, close the file.
  2067.                           
  2068.                           WARNING : You MUST call this routine before using
  2069.                           any of the GAPQBDR functions.  After calling this
  2070.                           routine, you MUST call init.door.
  2071.           
  2072.                Example :  call read.cnf("TOURIST.CNF")
  2073.                           call init.door
  2074.           
  2075.           
  2076.                   Name :  read.doorsys%
  2077.                Purpose :  Reads the DOOR.SYS universal door interface file
  2078.             Parameters :  None
  2079.           Return Value :  0 = no error, 1 = error
  2080.           
  2081.            Description :  Internal routine called by init.door.  Reads the
  2082.                           DOOR.SYS file and initializes any global vari-
  2083.                           ables that depend on the information in that
  2084.                           file.
  2085.           
  2086.                Example :  c% = read.doorsys%
  2087.           
  2088.           
  2089.                   Name :  read.gapdos%
  2090.                Purpose :  Reads the GAP Communications DOS file.
  2091.             Parameters :  None
  2092.           Return Value :  0 = no error, 1 = error
  2093.           
  2094.            Description :  Reads the GAPDOS.DAT remote exit to DOS file.  If
  2095.                           you have a need for the information in this file,
  2096.                           or if you need to modify the record variables,
  2097.                           this function will read the file for you.  The
  2098.                           record variables are contained in a variable
  2099.                           called gapdos.
  2100.                           
  2101.                           WARNING : Do NOT modify the string fields in
  2102.                           GAPDOS.DAT. If the gapdos.userindex field is
  2103.                           changed, GAP will be unable to find the user in
  2104.                           the userfile upon return from the door.
  2105.                           
  2106.                           The only proper way to update this file is to
  2107.  
  2108.  
  2109.  
  2110.                                        Page 31
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2117.  
  2118.  
  2119.                           first read it.  Make any changes to the variables
  2120.                           themselves or use your own temporary variables.
  2121.                           Then call write.gapdos to update the record.
  2122.           
  2123.                Example :  c% = read.gapdos%
  2124.           
  2125.           
  2126.                   Name :  read.gapuser%
  2127.                Purpose :  Reads the GAP Communications USERS.DAT file
  2128.             Parameters :  None
  2129.           Return Value :  0 = no error, 1 = error
  2130.           
  2131.            Description :  Reads the user record of the current user in the
  2132.                           GAP USERS.DAT file.  The record variables are
  2133.                           contained in a variable called user.
  2134.           
  2135.                Example :  c% = read.gapuser%
  2136.           
  2137.           
  2138.                   Name :  read.pcbsys%
  2139.                Purpose :  Reads the PCBOARD.SYS file.
  2140.             Parameters :  None
  2141.           Return Value :  0 = no error, 1 = error
  2142.           
  2143.            Description :  For a PCB setup, this function is automatically
  2144.                           called by init.door.  Do not use unless do.pcb is
  2145.                           set to 1.
  2146.           
  2147.                Example :  c% = read.pcbsys%
  2148.           
  2149.                   Name :  read.pcbuser%
  2150.                Purpose :  Reads the PCB USERS file.
  2151.             Parameters :  None
  2152.           Return Value :  0 = no error, 1 = error
  2153.           
  2154.            Description :  For a PCB setup, this function is automatically
  2155.                           called by init.door.  Do not use unless do.pcb is
  2156.                           set to 1.  Note that to change the fields
  2157.                           downbytes, upbytes, or lastmsg, you will need to
  2158.                           use the QB functions CVSMBF or CVDMBF.
  2159.           
  2160.                Example :  c% = read.pcbuser%
  2161.           
  2162.           
  2163.                   Name :  right.trim$
  2164.                Purpose :  Trims spaces from the end of NULL terminated
  2165.                           strings
  2166.             Parameters :  String containing the spaces.
  2167.           Return Value :  String without the spaces.
  2168.           
  2169.            Description :  This function will remove the NULL and trim any
  2170.                           spaces from the right end of any 'C' string.
  2171.           
  2172.                Example :  username$ = right.trim$(gapdos.username)
  2173.  
  2174.  
  2175.  
  2176.                                        Page 32
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2183.  
  2184.  
  2185.                   Name :  set.status
  2186.                Purpose :  To display and update the sysop status line
  2187.             Parameters :  0 = set the status line, 1 = update the status
  2188.                           line, 4 = show other user stats
  2189.           Return Value :  None
  2190.           
  2191.            Description :  This routine is used internally.  There should be
  2192.                           no reason to call it unless you have modified a
  2193.                           user's stats and you need to update those stats
  2194.                           on the status line.  In this case, you should use
  2195.                           option 0.
  2196.           
  2197.                Example :  call set.status(0)
  2198.           
  2199.           
  2200.                   Name :  show.file
  2201.                Purpose :  To display a text file
  2202.             Parameters :  The full path and file name to the file to be
  2203.                           shown
  2204.           Return Value :  None
  2205.           
  2206.            Description :  Many door programs have welcome, news, exit, help
  2207.                           and other files to show to the user at various
  2208.                           points in the program.  This is the function that
  2209.                           allows you to do that.  This function tries to be
  2210.                           as intelligent as it possibly can in determining
  2211.                           the sysop's wishes. To display a file to the
  2212.                           user, call the function with the full
  2213.                           drive\path\filename of the file to display.
  2214.                           
  2215.                           If you have color and non-color versions of files
  2216.                           pass the name of the non-color version as this
  2217.                           function will automatically append a "G" to the
  2218.                           filename if the user is in color mode.  In fact,
  2219.                           this function will ALWAYS try to find a file with
  2220.                           a "G" appended to the end of the name (if the
  2221.                           user is in color mode) before it looks for the
  2222.                           actual file by the name you specified.  If you
  2223.                           pass "WELCOMEG" to this function and the user is
  2224.                           in color mode, it will first try to find a file
  2225.                           with the name of "WELCOMEGG".
  2226.                           
  2227.                           As with GAP Communications, your text files can
  2228.                           have certain control characters as the first
  2229.                           character in the file.  A "{" signals that the
  2230.                           more prompt should never display.  In other
  2231.                           words, GAPQBDR will not keep track of the number
  2232.                           of lines displayed and will never issue a more
  2233.                           prompt.  This is useful for very long ANSI files.
  2234.                           A "@" signals that the pause prompt should be
  2235.                           displayed when the screen is full instead of a
  2236.                           more prompt.  This is very handy when you want
  2237.                           the user to see the file in its entirety.  The
  2238.                           user will not be allowed to break out of the file
  2239.  
  2240.  
  2241.  
  2242.                                        Page 33
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2249.  
  2250.  
  2251.                           read.
  2252.                           
  2253.                           WARNING : The "{" or "@" MUST appear as the VERY
  2254.                           first character in the file.  If you use an ANSI
  2255.                           editor, be aware that the first few characters in
  2256.                           a file will usually be an ANSI color sequence.
  2257.                           You normally have to edit the file with a text
  2258.                           editor to insert the control character.
  2259.                           
  2260.                           Because QB 4.x is EXTREMELY slow when it comes to
  2261.                           function calls, all input and output is done "in
  2262.                           line". Despite QB's high overhead, this function
  2263.                           is pretty fast.
  2264.                           
  2265.                           GAPQBDR does not have GAP's ability to protect
  2266.                           the status line.  Because of this, it is possible
  2267.                           for an ANSI file that contains clear screen codes
  2268.                           to erase the status line.  At the end of the
  2269.                           function, the status line will be re-drawn just
  2270.                           in case.  Since most ANSI files contain the clear
  2271.                           screen codes at the beginning of the file,
  2272.                           show.file will remove any such codes during the
  2273.                           first read of the file.
  2274.                           
  2275.                           Pressing CTRL K or CTRL X will abort any file
  2276.                           display if the file does not begin with a "@".
  2277.                           
  2278.                           REMEMBER : If you have both color and non-color
  2279.                           versions of the same files, pass the name of the
  2280.                           non-color version.  Also, the actual disk files
  2281.                           must be named in such a way that they have no
  2282.                           file extension and the color version ends with a
  2283.                           "G".
  2284.           
  2285.                Example :  call show.file("WELCOME")
  2286.                           call show.file("C:\GAP\GEN\WELCOME")
  2287.           
  2288.           
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.                                        Page 34
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2315.  
  2316.  
  2317.                   Name :  show.mess
  2318.                Purpose :  Displays a message
  2319.             Parameters :  Message, ring the bell, issue a New Line
  2320.           Return Value :  None
  2321.           
  2322.            Description :  Finally!  After all of this, just how do you dis-
  2323.                           play a message to the user?  Well, here it is.
  2324.                           This is the string output function for GAPQBDR.
  2325.                           Under most circumstances, this is the one func-
  2326.                           tion that you would call to display output to the
  2327.                           user. There should be no reason to ever call
  2328.                           putkey or putachar, as they are basically inter-
  2329.                           nal routines.
  2330.                           
  2331.                           There should be no reason to EVER use the Basic
  2332.                           print statement unless you need to display a mes-
  2333.                           sage to the local screen that you do not want the
  2334.                           remote user to see.  In other words, ALL string
  2335.                           output should be done through this function.  If
  2336.                           there is a reason to display information locally
  2337.                           it would be much easier and more efficient to
  2338.                           keep track of the l.ocal variable, set it to 1,
  2339.                           call show.mess with the strings to be displayed,
  2340.                           then restore the l.ocal variable to what it was
  2341.                           before, instead of using the print function which
  2342.                           cannot display ANSI sequences (forcing you to
  2343.                           translate ANSI codes to color statements).
  2344.                           
  2345.                           The three parameters are :
  2346.            
  2347.                             1 - the string to display
  2348.                             2 - YES or NO if you want to sound the remote
  2349.                                 user's bell.
  2350.                             3 - YES or NO if you want to issue a CR/LF
  2351.                                 after displaying the string.
  2352.           
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                                        Page 35
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2381.  
  2382.  
  2383.                Example :  ' the first show.mess displays the string and
  2384.                           ' leaves the cursor on the same line.  The second
  2385.                           ' show.mess displays the string, rings the remote
  2386.                           ' user's bell, and drops the cursor to the next
  2387.                           ' line.
  2388.                           
  2389.                           call nl(1)
  2390.                           call show.mess("Are you ready? (Y/N) : ",NO,NO)
  2391.                           
  2392.                           a$ = space$(3)
  2393.                           call get.string(a$)
  2394.                           
  2395.                           if left$(a$,1) = "Y" then
  2396.                              ' begin whatever it is you want to begin
  2397.                           else
  2398.                              call nl(1)
  2399.                              call show.mess("Too Bad!",YES,YES)
  2400.                              end
  2401.                           end if
  2402.           
  2403.           
  2404.                   Name :  time.credit
  2405.                Purpose :  Keeps track of time and credits the user with
  2406.                           time elapsed
  2407.             Parameters :  1 = start timer, 0 = end timer
  2408.           Return Value :  None
  2409.           
  2410.            Description :  This is basically an internal routine called by
  2411.                           chat and sysop shell to DOS so that the user is
  2412.                           not penalized for time used.  It updates a global
  2413.                           variable called timecredit.  Timecredit is used
  2414.                           in the calculations that determine the user's
  2415.                           time remaining.
  2416.                           
  2417.                           If you wish to use this feature in your own rou-
  2418.                           tines, prior to entering your routine, call
  2419.                           time.credit with a 1 and it will start the timer.
  2420.                           When your routine is finished, call time.credit
  2421.                           with a 0 and the timer will stop.  The variable
  2422.                           timecredit will be updated with the elapsed time.
  2423.           
  2424.                Example :  call time.credit(1)            ' start the timer
  2425.                           call do.chat                   ' chat with user
  2426.                           call time.credit(0)            ' stop the timer
  2427.                           
  2428.                           ' Note that this is simply an example.  do.chat
  2429.                           ' calls time.credit on its own.  In the above
  2430.                           ' example, if the sysop chat with the user took
  2431.                           ' 10  minutes, the user will be credited with
  2432.                           ' that 10 minutes as will be reflected in the
  2433.                           ' timecredit variable.
  2434.           
  2435.           
  2436.  
  2437.  
  2438.  
  2439.  
  2440.                                        Page 36
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2447.  
  2448.  
  2449.                   Name :  time.left
  2450.                Purpose :  To compute the user's time remaining
  2451.             Parameters :  None
  2452.           Return Value :  None
  2453.           
  2454.            Description :  This is the routine that is called by the input
  2455.                           and output routines to compute the user's time
  2456.                           remaining. It is not necessary for the programmer
  2457.                           to call this routine directly.
  2458.                           
  2459.                           A global variable called timeleft will be updated
  2460.                           with each call.  This variable may be used in
  2461.                           prompts that display the user's remaining time.
  2462.                           
  2463.                           As long as all input/output is performed thru
  2464.                           calls to the GAPQBDR library, the timeleft vari-
  2465.                           able will always be current.
  2466.           
  2467.                Example :  call time.left
  2468.           
  2469.           
  2470.                   Name :  update.clock
  2471.                Purpose :  Updates the status line clock
  2472.             Parameters :  None
  2473.           Return Value :  None
  2474.           
  2475.            Description :  Internal routine to update the status line clock.
  2476.           
  2477.                Example :
  2478.           
  2479.           
  2480.                   Name :  waitasec
  2481.                Purpose :  Pauses for the number of seconds specified.
  2482.             Parameters :  Number of seconds to pause
  2483.           Return Value :  None
  2484.           
  2485.            Description :  This function allows you to pause all processing
  2486.                           for the specified number of seconds.  It is in-
  2487.                           sensitive to processor speed and is immune to the
  2488.                           midnight rollover problem.
  2489.           
  2490.                Example :  call waitasec(10)              ' pause for 10 sec
  2491.           
  2492.           
  2493.                   Name :  wrap.word
  2494.                Purpose :  To wrap a word during sysop chats
  2495.             Parameters :  None
  2496.           Return Value :  None
  2497.           
  2498.            Description :  Internal function called by putkey to wrap words.
  2499.           
  2500.                Example :
  2501.           
  2502.           
  2503.  
  2504.  
  2505.  
  2506.                                        Page 37
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2513.  
  2514.  
  2515.                   Name :  write.gapdos%
  2516.                Purpose :  Updates the GAPDOS.DAT file
  2517.             Parameters :  None
  2518.           Return Value :  0 = no error, 1 = error
  2519.           
  2520.            Description :  This function allows the programmer to update the
  2521.                           GAP Communications remote exit to DOS system
  2522.                           file.  If the GAPDOS.DAT file is read at door be-
  2523.                           ginning,  the timecredit variable assigned to
  2524.                           gapdos.timecredit, and the GAPDOS.DAT file writ-
  2525.                           ten out at doors end, the user will be credited
  2526.                           with any time spent during a sysop chat or shell
  2527.                           to DOS.
  2528.           
  2529.                Example :  c% = read.gapdos%              ' read the file
  2530.                           
  2531.                           if c% = 0 then                 ' if no error...
  2532.                              timecredit = gapdos.timecredit
  2533.                           
  2534.                              ' do some processing
  2535.                           
  2536.                              ' give the user 20 more minutes
  2537.                           
  2538.                              timecredit = timecredit + 20
  2539.                              gapdos.timecredit = timecredit
  2540.                              c% = write.gapdos%          ' update the file
  2541.                           end if
  2542.           
  2543.           
  2544.                   Name :  write.gapuser%
  2545.                Purpose :  Updates the user record in GAP's USERS.DAT file
  2546.             Parameters :  None
  2547.           Return Value :  0 = no error, 1 = error
  2548.           
  2549.            Description :  This function allows you to update any variables
  2550.                           in the GAP USERS.DAT file for the current user.
  2551.                           
  2552.                           WARNING : The GAP USERS.DAT file contains C char-
  2553.                           acter arrays.  These are equivalent to Basic's
  2554.                           fixed length strings with the exception that the
  2555.                           C strings have a NULL character (chr$(0)) in the
  2556.                           last position.  If you modify any of these fixed
  2557.                           length strings, you MUST make sure that the
  2558.                           string is fully padded with  spaces and that the
  2559.                           NULL character is placed in the last string posi-
  2560.                           tion.  When assigning a value to a fixed length
  2561.                           string, Basic will automatically pad the fixed
  2562.                           length string with spaces. All the programmer
  2563.                           need to is insure that the NULL is inserted at
  2564.                           the end of the string.
  2565.                           
  2566.                           WARNING : The index for the user file consists of
  2567.                           the user's last name and first name.  Do not un-
  2568.                           der any circumstances modify either of these two
  2569.                           fields. Doing so will cause corruption of the
  2570.  
  2571.  
  2572.                                        Page 38
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.           GAPQBDR       (C) Copyright 1988,1989 The GAP Development Company
  2579.  
  2580.  
  2581.                           Index file.
  2582.           
  2583.                Example :  ' give the user a level of 50
  2584.                           
  2585.                           c% = read.gapuser%             ' 1st read record
  2586.                           user.level = 50
  2587.                           c% = write.gapuser%            ' update the rec
  2588.                           
  2589.                           ' allow user to change handle
  2590.                           
  2591.                           c% = read.gapuser%
  2592.                           if c% = 0 then
  2593.                              call show.mess("Enter New Handle : ",NO,NO)
  2594.                              handle$ = space$(15)
  2595.                              call get.string(handle$)
  2596.                              if handle$ <> "" then
  2597.                                 user.handle = handle$
  2598.                           
  2599.                                 mid$(user.handle,16,1) = chr$(0)
  2600.                                 c% = write.gapuser%
  2601.                                 if c% = 0 then
  2602.                                    show.mess("Saved new Handle",NO,YES)
  2603.                                 end if
  2604.                              end if
  2605.                           end if
  2606.           
  2607.           
  2608.                   Name :  write.pcbsys%
  2609.                Purpose :  Updates the PCBOARD.SYS file
  2610.             Parameters :  None
  2611.           Return Value :  0 = no error, 1 = error
  2612.           
  2613.            Description :  This function allows the programmer to update the
  2614.                           PCBOARD.SYS File.  Do not use unless do.pcb is
  2615.                           set to 1.
  2616.           
  2617.                Example :  c% = write.pcbsys%             ' write the file
  2618.           
  2619.           
  2620.                   Name :  write.pcbuser%
  2621.                Purpose :  Updates the PCB USERS file
  2622.             Parameters :  None
  2623.           Return Value :  0 = no error, 1 = error
  2624.           
  2625.            Description :  This function allows the programmer to update the
  2626.                           PCB USERS File.  Do not use unless do.pcb is set
  2627.                           to 1.  Note that you will need to use MKSMBF on
  2628.                           the field lastmsg, and MKDMBF on the fields
  2629.                           downbytes and upbytes, if you modified these
  2630.                           fields since reading the file.
  2631.           
  2632.                Example :  c% = write.pcbuser%            ' write the file
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.                                        Page 39
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.                               GAPQBDR LICENSE AGREEMENT
  2645.                               -------------------------
  2646.  
  2647.         This legal document is an agree-                                             GAP Development Company consents
  2648.         ment between  you, the end user,                                             in writing, in advance.
  2649.         and GAP Development Company.  By                                             
  2650.         using   the   GAPQBDR   software                                             Registration of  the SOFTWARE is
  2651.         (the "SOFTWARE") provided by GAP                                             REQUIRED as a condition of use.
  2652.         Development Company,  you  agree                                             
  2653.         to become  bound by the terms of                                             You are  granted a  royalty-free
  2654.         this agreement,  which  includes                                             right to  distribute  executable
  2655.         the  software  license  and  the                                             files created  using  the  SOFT-
  2656.         disclaimer of warranty.                                             WARE.   You may  not, under  any
  2657.                                                      circumstances   distribute   any
  2658.         This agreement  constitutes  the                                             part of  the SOFTWARE  with your
  2659.         complete agreement  between  you                                             executable files.
  2660.         and GAP Development Company.  If                                             
  2661.         you do not agree to the terms of                                             If you  purchased  the  SOFTWARE
  2662.         this agreement,  promptly return                                             SOURCE CODE,  you are  granted a
  2663.         the disks  and other  items that                                             nonexclusive,   personal,   non-
  2664.         are part of this product.                                             transferable, nonassignable  li-
  2665.                                                      cense  to  use  and  modify  the
  2666.         The SOFTWARE  may not be copied,                                             SOURCE CODE  and  to  distribute
  2667.         reproduced,  disclosed,   trans-                                             your programs.  You may  not re-
  2668.         ferred, or  reduced to any form,                                             produce or distribute the SOURCE
  2669.         including electronic  medium  or                                             CODE except  in executable  form
  2670.         machine readable form, or trans-                                             as part of your executable file.
  2671.         mitted or  publicly performed by                                             If you  distribute  your  source
  2672.         any means,  electronic or other-                                             code, you  may not  include  the
  2673.         wise,  unless   GAP  Development                                             SOFTWARE SOURCE  CODE as part of
  2674.         Company consents  in writing, in                                             your product.
  2675.         advance.                                             
  2676.                                                      This License  is effective until
  2677.         Th  SOFTWARE  contains  valuable                                             terminated.   This License  will
  2678.         trade  secrets  and  proprietary                                             terminate automatically  if  you
  2679.         information and  is protected by                                             fail to  comply with  any provi-
  2680.         federal copyright laws. Unautho-                                             sion of this License.
  2681.         rized use  of the  software  can                                             
  2682.         result  in   civil  damages  and                                             SUMMARY OF LIMITED WARRANTY:
  2683.         criminal prosecution.                                             
  2684.                                                      In summary,  the SOFTWARE is li-
  2685.         You may  use the  SOFTWARE on  a                                             censed AS  IS.    THERE  ARE  NO
  2686.         single computer  only.  You  may                                             WARRANTEES, EXPRESS  OR IMPLIED,
  2687.         not network the SOFTWARE or oth-                                             INCLUDING BUT NOT LIMITED TO THE
  2688.         erwise use  it on  more than one                                             IMPLIED   WARRANTIES   OF   MER-
  2689.         computer or terminal at the same                                             CHANTABILITY AND  FITNESS FOR  A
  2690.         time.                                             PARTICULAR PURPOSE, AND ALL SUCH
  2691.                                                      WARRANTIES  ARE   EXPRESSLY  AND
  2692.         YOU MAY  NOT COPY  the  SOFTWARE                                             SPECIFICALLY DISCLAIMED.   IN NO
  2693.         except  to  place  the  programs                                             EVENT SHALL GAP DEVELOPMENT COM-
  2694.         onto your  hard disk and to make                                             PANY BE  RESPONSIBLE FOR ANY IN-
  2695.         archival  backup   copies   onto                                             DIRECT, SPECIAL,  INCIDENTAL  OR
  2696.         floppy disks  for your  personal                                             CONSEQUENTIAL  DAMAGES  OR  LOST
  2697.         use as  permitted  by  this  Li-                                             PROFITS TO YOU OR ANY OTHER PER-
  2698.         cense.  You  may  not  copy  the                                             SON OR  ENTITY REGARDLESS OF THE
  2699.         written  materials  accompanying                                             LEGAL THEORY,  EVEN IF  WE  HAVE
  2700.         the software.  You may not grant                                             BEEN ADVISED  OF THE POSSIBILITY
  2701.         sublicenses  nor   transfer  the                                             OF SUCH DAMAGE.
  2702.         SOFTWARE or related materials in
  2703.         any form  to any  person  unless
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.                               REGISTRATION INFORMATION
  2714.                               ------------------------
  2715.             
  2716.             
  2717.             GAPQBDR  is   a  user-supported   program,  also   known  as
  2718.             'shareware'.  Shareware is a means by which users may 'test-
  2719.             drive' software before purchasing.  Generally, it allows the
  2720.             user to  evaluate the  software for  a period  of  30  days.
  2721.             After the  evaluation period  the user  must either register
  2722.             the product or cease using it.
  2723.             
  2724.             You are  permitted under  the terms  of  the  above  License
  2725.             Agreement to  use GAPQBDR  for a  period of  30 days without
  2726.             payment.  If you continue to use the product past the 30 day
  2727.             evaluation period,  you must register your copy as described
  2728.             below.
  2729.             
  2730.             Commercial  use  of  this  software  absolutely  requires  a
  2731.             registration within  the 30  day  period.    Commercial  use
  2732.             includes any  software written by you which utilizes GAPQBDR
  2733.             and which  you charge  any sum  of money for the use of your
  2734.             software.   This includes shareware registration, donations,
  2735.             registration fees,  or any  method  you  use  or  devise  to
  2736.             solicit funds from the users of your software.
  2737.             
  2738.             Commercial use  also includes  bundling GAPQBDR  with  other
  2739.             software even if that other software does not utilize any of
  2740.             the GAPQBDR  functions.   This type  of  commercial  use  is
  2741.             strictly prohibited.
  2742.             
  2743.             
  2744.             A great  deal of  time, money, and effort went into creating
  2745.             GAPQBDR.   Unlike other  libraries of this type, GAPQBDR was
  2746.             written from scratch and does not have as a basis, "borrowed
  2747.             code".   We have utilized many of the latest features of the
  2748.             Quick  Basic   compiler  and   wrote  critical  sections  in
  2749.             assembler for speed.
  2750.             
  2751.             Registration of  GAPQBDR  is  a  one  time  fee  of  $25.00.
  2752.             Payment of  this fee  entitles  you  to  one  year  of  free
  2753.             upgrades, product  support, the  right to use GAPQBDR in any
  2754.             executable program  you  sell  or  distribute,  and  a  good
  2755.             conscience.
  2756.             
  2757.             
  2758.             Source code  is available to registered users for a one time
  2759.             license fee  of $25.00.   The source code is fully commented
  2760.             and well structured.
  2761.             
  2762.             
  2763.                               GAPQBDR Support Board :
  2764.             
  2765.               The Crow's Nest BBS         (714)493-3819  Node 1
  2766.                                           (714)493-9851  Node 2
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.                                 GAPQBDR REGISTRATION
  2780.                                 --------------------
  2781.             
  2782.             
  2783.             Please fill in and detach the following sheet and mail it to
  2784.             GAP Development Company.
  2785.             ------------------------------------------------------------
  2786.             
  2787.             
  2788.             I understand and accept the GAPQBDR License Agreement.
  2789.             
  2790.             
  2791.                  Accepted By : ____________________________________
  2792.                                (signature)
  2793.                  
  2794.                  Accepted By : ____________________________________
  2795.                                (printed name)
  2796.                  
  2797.                         Date : ____________
  2798.                  
  2799.                  
  2800.                      Product : GAPQBDR
  2801.             
  2802.             
  2803.             Licensee Information :
  2804.             
  2805.                       Name : ___________________________________________
  2806.             
  2807.                    Address : ___________________________________________
  2808.             
  2809.                    Address : ___________________________________________
  2810.             
  2811.             City,State,Zip : ___________________________________________
  2812.             
  2813.                Voice Phone : ________________________
  2814.             
  2815.             
  2816.             ------------------------------------------------------------
  2817.                 #   Description                              Price
  2818.             ------------------------------------------------------------
  2819.               2001  GAPQBDR Run Time Library        25.00     __________
  2820.               2002  GAPQBDR Source Code License     25.00     __________
  2821.             
  2822.                     Total Due                                 __________
  2823.                     Less Credit(s)                            __________
  2824.                     Total Amount Enclosed                     __________
  2825.             
  2826.             ------------------------------------------------------------
  2827.                     Payment may be made by check or money order
  2828.             ------------------------------------------------------------
  2829.             
  2830.                                         GAP Development Company
  2831.                                        24242 Porto Fino  RT 7715
  2832.                                      Laguna Niguel, CA  92677-3844
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.                                         INDEX
  2843.                                         -----
  2844.  
  2845.           @  33                                                   BLUE  11
  2846.           a.ccess%  22                                                   BMAGENTA  11
  2847.           ANSI  2, 3, 11, 17, 22, 33, 35                                                   BRED  11
  2848.           backspace  23                                                   BROWN  11
  2849.           bell  35                                                   BWHITE  11
  2850.           chat  2, 24, 29, 30, 36, 37,                                                   CYAN  11
  2851.                38                                                   GREEN  11
  2852.           ckeypress%  23                                                   MAGENTA  11
  2853.           clear.scr  23                                                   RED  11
  2854.           COMMAND$  5                                                   WHITE  11
  2855.           communications file  6                                                   YELLOW  11
  2856.           communications port  3, 5                                                 General
  2857.           configuration file  5                                                   NO  11
  2858.           CTS  2                                                   YES  11
  2859.           CVDMBF  7, 16, 32                                               Integers
  2860.           CVSMBF  7, 16, 32                                                 DOOR.SYS
  2861.           do.chat  24                                                   alarm  12
  2862.           do.pcb  6, 32, 39                                                   baud  12
  2863.           DOOR.SYS  5, 6, 12, 21, 30                                                   bell  12
  2864.           DTR  3                                                   c.olor  12
  2865.           elap.time  24                                                   expert  12
  2866.           Error  4, 5, 22, 27, 30                                                   l.ocal  12
  2867.           file number  5                                                   level  12
  2868.           Files                                                   minsleft  12
  2869.             Aborting  34                                                   node  12
  2870.             Color  33                                                   page  12
  2871.             Communications  6                                                   parity  12
  2872.             Configuration  5, 28, 30                                                   port  12
  2873.             DOOR.SYS  31                                                   printer  12
  2874.             Errors  22                                                   s.creen  12
  2875.             GAPDOS.DAT  31, 38                                                   userbaud  12
  2876.             Include  4, 5                                                 GAPDOS
  2877.             Opening  22                                                   gapdos.baud  13
  2878.             PCB USERS  32                                                   gapdos.forumnum  13
  2879.             PCBOARD.SYS  32                                                   gapdos.givetime  13
  2880.             Showing  33                                                   gapdos.localc  13
  2881.             System  24, 27                                                   gapdos.minavail  13
  2882.             USERS.DAT  32, 38                                                   gapdos.port  13
  2883.           Functions  22                                                   gapdos.timecredit  14
  2884.           GAPBBS.CNF  30                                                   gapdos.userbaud  14
  2885.           GAPDOS.DAT  9, 13, 21, 30                                                 General
  2886.           get.string  13, 24, 25, 26,                                                   do.pcb  13
  2887.                29, 36, 39                                                   noup  13
  2888.           get.time&  26                                                   timecredit  13
  2889.           getakey%  26                                                   timeleft  13
  2890.           getrand%  27                                                 PCBSYS
  2891.           Global Variables                                                   pcbsys.minsleft  15
  2892.             Constants                                                   pcbsys.timeallowed  15
  2893.               ANSI                                                   pcbsys.timecredit  15
  2894.                 BBLACK  11                                                   pcbsys.timegiven  15
  2895.                 BBLUE  11                                                   pcbsys.timeon  15
  2896.                 BCYAN  11                                                   pcbsys.timeused  15
  2897.                 BGREEN  11                                                   pcbsys.ttlbytes  15
  2898.                 BLACK  11                                                   pcbsys.userrec  15
  2899.  
  2900.  
  2901.  
  2902.                                        Page 43
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.                                         INDEX
  2909.                                         -----
  2910.  
  2911.               PCBUSERS                                                   gapdos.exitdos  13
  2912.                 pcbuser.downloads  15                                                   gapdos.userfirst  14
  2913.                 pcbuser.timeson  16                                                   gapdos.userindex  14
  2914.                 pcbuser.uploads  16                                                   gapdos.username  14
  2915.               USERS                                                 General
  2916.                 user.curdown  14                                                   anystring1  13
  2917.                 user.lastfrm  14                                                   bbs.dir  13
  2918.                 user.level  14                                                   board.name  13
  2919.                 user.minutes  14                                                   gendir  13
  2920.                 user.page  14                                                   maindir  13
  2921.             Longs                                                   sysname  13
  2922.               DOOR.SYS                                                 PCBSYS
  2923.                 downbytes  12                                                   pcbsys.baud  15
  2924.                 downloads  12                                                   pcbsys.calleralarm  15
  2925.                 maxbytes  12                                                   pcbsys.colorc  15
  2926.                 recnum  12                                                   pcbsys.ctime  15
  2927.                 timeson  12                                                   pcbsys.display  15
  2928.                 upbytes  12                                                   pcbsys.eactive  15
  2929.                 uploads  12                                                   pcbsys.errcorrect  15
  2930.               GAPDOS                                                   pcbsys.event  15
  2931.                 gapdos.callbytes  13                                                   pcbsys.forumnum  15
  2932.                 gapdos.joined  13                                                   pcbsys.node  15
  2933.                 gapdos.starttime  13                                                   pcbsys.pagebell  15
  2934.               General                                                   pcbsys.password  15
  2935.                 starttime  13                                                   pcbsys.port  15
  2936.                 temptime  13                                                   pcbsys.printer  15
  2937.                 timenow  13                                                   pcbsys.sevent  15
  2938.               USERS                                                   pcbsys.sysopnext  15
  2939.                 user.blts  14                                                   pcbsys.userbaud  15
  2940.                 user.curbytes  14                                                   pcbsys.userfirst  15
  2941.                 user.doors  14                                                   pcbsys.username  15
  2942.                 user.downloads  14                                                 PCBUSERS
  2943.                 user.joined  14                                                   pcbuser.bphone  15
  2944.                 user.lastmsg  14                                                   pcbuser.city  15
  2945.                 user.mesleft  14                                                   pcbuser.cnfregis  15
  2946.                 user.mesread  14                                                   pcbuser.delete  15
  2947.                 user.timeson  14                                                   pcbuser.downbytes  15
  2948.                 user.ttlbytes  14                                                   pcbuser.expert  15
  2949.                 user.ttlmins  14                                                   pcbuser.hphone  15
  2950.                 user.upbytes  14                                                   pcbuser.lastconf  15
  2951.                 user.uploads  14                                                   pcbuser.lastdate  16
  2952.             Strings                                                   pcbuser.lastdir  16
  2953.               DOOR.SYS                                                   pcbuser.lastime  16
  2954.                 bphone  12                                                   pcbuser.lastmsg  16
  2955.                 city  12                                                   pcbuser.lastmsg1  16
  2956.                 first  12                                                   pcbuser.level  16
  2957.                 hphone  12                                                   pcbuser.name  16
  2958.                 last  12                                                   pcbuser.page  16
  2959.                 lastdate  12                                                   pcbuser.passwd  16
  2960.                 password  12                                                   pcbuser.protocol  16
  2961.                 subscrip  12                                                   pcbuser.regisdate  16
  2962.                 username  12                                                   pcbuser.upbytes  16
  2963.               GAPDOS                                                 USERS
  2964.                 gapdos.didnew  13                                                   user.bphone  14
  2965.  
  2966.  
  2967.  
  2968.                                        Page 44
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.                                         INDEX
  2975.                                         -----
  2976.  
  2977.                 user.city  14                                             timeleft  26, 37
  2978.                 user.expert  14                                             Trimming Spaces  32
  2979.                 user.fname  14                                             update.clock  37
  2980.                 user.handle  14                                             USERS.DAT  9, 14, 21
  2981.                 user.hphone  14                                             user defined keys  4
  2982.                 user.lastdate  14                                             waitasec  37
  2983.                 user.lastdir  14                                             wrap.word  37
  2984.                 user.lasttime  14                                             write.gapdos%  38
  2985.                 user.lname  14                                             write.gapuser%  38
  2986.                 user.passwd  14                                             write.pcbsys%  39
  2987.                 user.private  14                                             write.pcbuser%  39
  2988.                 user.protocol  14                                             {  33
  2989.                 user.subscribe  14
  2990.                 user.sysop  14
  2991.           IEEE  6, 7
  2992.           init.door  5, 15, 27, 28, 30,
  2993.                31, 32
  2994.           leave  5, 27
  2995.           mbf  6, 7
  2996.           MKDMBF  39
  2997.           MKSMBF  39
  2998.           more  28
  2999.           New Line  28, 35
  3000.           nl  28
  3001.           no.carrier  28
  3002.           node  6
  3003.           noup  25
  3004.           ON KEY  4
  3005.           open.gap%  28
  3006.           pagesysop  29
  3007.           pause  29, 37
  3008.           PCB USERS  15, 21
  3009.           PCBOARD.SYS  5, 6, 15, 21
  3010.           putachar  29, 35
  3011.           putkey  30, 35
  3012.           read.cnf  4, 5, 30
  3013.           read.doorsys%  31
  3014.           read.gapdos%  31
  3015.           read.gapuser%  32
  3016.           read.pcbsys%  32
  3017.           read.pcbuser%  32
  3018.           right.trim$  32
  3019.           set.status  33
  3020.           show.file  33
  3021.           show.mess  23, 35, 39
  3022.           Spaces
  3023.             Trimming  32
  3024.             USERS.DAT  38
  3025.           Status Line  2, 33, 34, 37
  3026.           string output  35
  3027.           Subroutines  22
  3028.           time.credit  36
  3029.           time.left  37
  3030.           timecredit  36, 38
  3031.  
  3032.  
  3033.  
  3034.                                        Page 45
  3035.  
  3036.  
  3037.